Skip to content

Commit b92d99f

Browse files
committed
React on addon unregistration errors
1 parent fb4c351 commit b92d99f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

mitsuba-blender/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ def unregister_addon():
9393
This may fail if Mitsuba wasn't found, hence the try catch guard
9494
'''
9595
try:
96-
engine.unregister()
9796
nodes.unregister()
97+
engine.unregister()
9898
ui.unregister()
9999
operators.unregister()
100100
properties.unregister()
@@ -289,7 +289,8 @@ def register():
289289
def unregister():
290290
for cls in classes:
291291
unregister_class(cls)
292-
unregister_addon()
292+
if not unregister_addon():
293+
print('FAILED TO UNREGISTER ADDON')
293294

294295
if __name__ == '__main__':
295296
register()

mitsuba-blender/nodes/materials/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def register():
3434
register_class(cls)
3535

3636
def unregister():
37-
unregister_node_categories('MITSUBA_MATERIAL_TREE')
38-
3937
for cls in classes:
4038
unregister_class(cls)
39+
40+
unregister_node_categories('MITSUBA_MATERIAL_TREE')

0 commit comments

Comments
 (0)