[Bf-extensions-cvs] [503570ad] master: glTF exporter: Fix T93929 - back compatibility for use_selection

Julien Duroure noreply at git.blender.org
Fri Dec 17 08:52:17 CET 2021


Commit: 503570ad703268ef55cfa38beaa28ad15e3ecc57
Author: Julien Duroure
Date:   Fri Dec 17 08:51:31 2021 +0100
Branches: master
https://developer.blender.org/rBA503570ad703268ef55cfa38beaa28ad15e3ecc57

glTF exporter: Fix T93929 - back compatibility for use_selection

===================================================================

M	io_scene_gltf2/__init__.py

===================================================================

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 069596fa..c7c44c7c 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -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):



More information about the Bf-extensions-cvs mailing list