Skip to content

Commit

Permalink
More attempt to fix Extension after reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Feb 11, 2023
1 parent 785ecc8 commit 431fbc7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,8 @@ def __traverse_property(node):
# I don't know why, but after reloading script, this condition failed
# So using name comparison, instead of isinstance
#if isinstance(node, gltf2_io_extensions.Extension):
if node and type(node).name == gltf2_io_extensions.Extension.name:
if isinstance(node, gltf2_io_extensions.Extension) \
or (node and hasattr(type(node), "extension")):
extension = self.__traverse(node.extension)
self.__append_unique_and_get_index(self.__gltf.extensions_used, node.name)
if node.required:
Expand Down
2 changes: 2 additions & 0 deletions addons/io_scene_gltf2/io/com/gltf2_io_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

class Extension:
"""Container for extensions. Allows to specify requiredness"""
extension = True

def __init__(self, name: str, extension: Dict[str, Any], required: bool = True):
self.name = name
self.extension = extension
Expand Down

0 comments on commit 431fbc7

Please sign in to comment.