[Bf-extensions-cvs] [4d8b2dc9] master: glTF exporter: remove back compatibility of export_selection -> use_selection

Julien Duroure noreply at git.blender.org
Sun Mar 13 11:40:37 CET 2022


Commit: 4d8b2dc95f98493f44d51ace3712bf895686c670
Author: Julien Duroure
Date:   Sun Mar 13 11:39:29 2022 +0100
Branches: master
https://developer.blender.org/rBA4d8b2dc95f98493f44d51ace3712bf895686c670

glTF exporter: remove back compatibility of export_selection -> use_selection

This is now more than a year old. Removing the back compatibility. Use can of course set again the value in UI at export

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

M	io_scene_gltf2/__init__.py

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

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index b87af39a..dcef27b1 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -4,7 +4,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": (3, 2, 13),
+    "version": (3, 2, 14),
     'blender': (3, 1, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
@@ -287,13 +287,6 @@ class ExportGLTF2_Base:
         default=False
     )
 
-    # keep it for compatibility (for now)
-    export_selected: BoolProperty(
-        name='Selected Objects',
-        description='Export selected objects only',
-        default=False
-    )
-
     use_selection: BoolProperty(
         name='Selected Objects',
         description='Export selected objects only',
@@ -462,11 +455,6 @@ 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():
                     setattr(self, k, v)
                 self.will_save_settings = True
@@ -503,8 +491,6 @@ 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):
@@ -554,18 +540,12 @@ class ExportGLTF2_Base:
         export_settings['gltf_colors'] = self.export_colors
         export_settings['gltf_cameras'] = self.export_cameras
 
-        # compatibility after renaming export_selected to use_selection
-        if self.export_selected is True:
-            self.report({"WARNING"}, "export_selected is now renamed use_selection, and will be deleted in a few release")
-            export_settings['gltf_selected'] = self.export_selected
-        else:
-            export_settings['gltf_selected'] = self.use_selection
 
         export_settings['gltf_visible'] = self.use_visible
         export_settings['gltf_renderable'] = self.use_renderable
         export_settings['gltf_active_collection'] = self.use_active_collection
 
-        # export_settings['gltf_selected'] = self.use_selection This can be uncomment when removing compatibility of export_selected
+        export_settings['gltf_selected'] = self.use_selection
         export_settings['gltf_layers'] = True  # self.export_layers
         export_settings['gltf_extras'] = self.export_extras
         export_settings['gltf_yup'] = self.export_yup



More information about the Bf-extensions-cvs mailing list