Skip to content

Commit 9e0a3fa

Browse files
fix registering properties and classes
1 parent d758aac commit 9e0a3fa

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

__init__.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,38 @@
1919
from . import panels
2020
from . import export_indicators # Still needed for timer and recent list
2121

22+
2223
# Registration
2324
classes = (
2425
*operators.classes,
2526
*panels.classes,
2627
# export_indicators registers its own classes/timer
2728
)
2829

30+
2931
def register():
30-
# First register export indicators (including the timer)
31-
from . import export_indicators
32-
export_indicators.register()
32+
# First register properties
33+
properties.register_properties()
34+
35+
# Then register our classes
36+
for cls in classes:
37+
bpy.utils.register_class(cls)
3338

34-
# Then register operators which may use the timer
35-
from . import operators
36-
operators.register()
39+
# Finally register export indicators (including the timer)
40+
export_indicators.register()
3741

3842
def unregister():
39-
export_indicators.unregister() # Unregister timer first
43+
# First unregister export indicators (handles its own classes)
44+
export_indicators.unregister()
45+
46+
# Then unregister our other classes
4047
for cls in reversed(classes):
41-
bpy.utils.unregister_class(cls)
48+
try:
49+
bpy.utils.unregister_class(cls)
50+
except RuntimeError as e:
51+
print(f"Couldn't unregister {cls}: {e}")
52+
53+
# Finally unregister properties
4254
properties.unregister_properties()
4355

4456
if __name__ == "__main__":

0 commit comments

Comments
 (0)