Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2253 - distinct import & export draw #2313

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions addons/io_scene_gltf2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def invoke(self, context, event):
for addon_name in preferences.addons.keys():
try:
if hasattr(sys.modules[addon_name], 'glTF2ExportUserExtension') or hasattr(sys.modules[addon_name], 'glTF2ExportUserExtensions'):
exporter_extension_layout_draw[addon_name] = sys.modules[addon_name].draw
exporter_extension_layout_draw[addon_name] = sys.modules[addon_name].draw if hasattr(sys.modules[addon_name], 'draw_export') else sys.modules[addon_name].draw
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticed this line - I think this this should read:

exporter_extension_layout_draw[addon_name] = sys.modules[addon_name].draw_export if hasattr(....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

except Exception:
pass

Expand Down Expand Up @@ -1835,7 +1835,7 @@ def invoke(self, context, event):
for addon_name in preferences.addons.keys():
try:
if hasattr(sys.modules[addon_name], 'glTF2ImportUserExtension') or hasattr(sys.modules[addon_name], 'glTF2ImportUserExtensions'):
importer_extension_layout_draw[addon_name] = sys.modules[addon_name].draw
importer_extension_layout_draw[addon_name] = sys.modules[addon_name].draw_import if hasattr(sys.modules[addon_name], 'draw_import') else sys.modules[addon_name].draw
except Exception:
pass

Expand Down
2 changes: 1 addition & 1 deletion example-addons/example_gltf_exporter_extension/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def unregister():
del bpy.types.Scene.ExampleExtensionProperties


def draw(context, layout):
def draw_export(context, layout):
header, body = layout.panel("GLTF_addon_example_exporter", default_closed=False)

props = bpy.context.scene.ExampleExtensionProperties
Expand Down
2 changes: 1 addition & 1 deletion example-addons/example_gltf_importer_extension/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ExampleImporterExtensionProperties(bpy.types.PropertyGroup):



def draw(context, layout):
def draw_import(context, layout):
header, body = layout.panel("GLTF_addon_example_importer", default_closed=False)

props = bpy.context.scene.ExampleImporterExtensionProperties
Expand Down
Loading