glTF exporter: Fix T93929 - back compatibility for use_selection

This commit is contained in:
Julien Duroure 2021-12-17 08:51:31 +01:00
parent d737f2016d
commit 503570ad70
Notes: blender-bot 2023-02-14 18:28:08 +01:00
Referenced by issue #93929, Error while exporting gltf in Blender 3.0
1 changed files with 9 additions and 9 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 8, 2),
"version": (1, 8, 3),
'blender': (3, 0, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
@ -461,14 +461,13 @@ class ExportGLTF2_Base:
self.will_save_settings = False
if settings:
try:
if 'export_selected' in settings.keys(): # Back compatibility for export_selected --> use_selection
setattr(self, "use_selection", settings['export_selected'])
settings["use_selection"] = settings['export_selected']
del settings['export_selected']
print("export_selected is now renamed use_selection, and will be deleted in a few release")
for (k, v) in settings.items():
if k == "export_selected": # Back compatibility for export_selected --> use_selection
setattr(self, "use_selection", v)
del settings[k]
settings["use_selection"] = v
print("export_selected is now renamed use_selection, and will be deleted in a few release")
else:
setattr(self, k, v)
setattr(self, k, v)
self.will_save_settings = True
except (AttributeError, TypeError):
@ -503,7 +502,8 @@ class ExportGLTF2_Base:
x: getattr(self, x) for x in dir(all_props)
if (x.startswith("export_") or x in exceptional) and all_props.get(x) is not None
}
if 'export_selected' in export_props.keys():
del export_props['export_selected'] # Do not save this property, only here for backward compatibility
context.scene[self.scene_key] = export_props
def execute(self, context):