Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'io_scene_gltf2/__init__.py')
-rwxr-xr-xio_scene_gltf2/__init__.py47
1 files changed, 24 insertions, 23 deletions
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index b290f946..fd0687b9 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, 9),
+ "version": (3, 2, 15),
'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
@@ -1171,6 +1151,20 @@ class ImportGLTF2(Operator, ImportHelper):
self.loglevel = logging.NOTSET
+class GLTF_AddonPreferences(bpy.types.AddonPreferences):
+ bl_idname = __package__
+
+ settings_node_ui : bpy.props.BoolProperty(
+ default= False,
+ description="Displays glTF Settings node in Shader Editor (Menu Add > Ouput)"
+ )
+
+
+ def draw(self, context):
+ layout = self.layout
+ row = layout.row()
+ row.prop(self, "settings_node_ui", text="Shader Editor Add-ons")
+
def menu_func_import(self, context):
self.layout.operator(ImportGLTF2.bl_idname, text='glTF 2.0 (.glb/.gltf)')
@@ -1188,21 +1182,26 @@ classes = (
GLTF_PT_export_animation_skinning,
GLTF_PT_export_user_extensions,
ImportGLTF2,
- GLTF_PT_import_user_extensions
+ GLTF_PT_import_user_extensions,
+ GLTF_AddonPreferences
)
def register():
+ import io_scene_gltf2.blender.com.gltf2_blender_ui as blender_ui
for c in classes:
bpy.utils.register_class(c)
# bpy.utils.register_module(__name__)
+ blender_ui.register()
+
# add to the export / import menu
bpy.types.TOPBAR_MT_file_export.append(menu_func_export)
bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
def unregister():
+ import io_scene_gltf2.blender.com.gltf2_blender_ui as blender_ui
for c in classes:
bpy.utils.unregister_class(c)
for f in exporter_extension_panel_unregister_functors:
@@ -1213,6 +1212,8 @@ def unregister():
f()
importer_extension_panel_unregister_functors.clear()
+ blender_ui.unregister()
+
# bpy.utils.unregister_module(__name__)
# remove from the export / import menu