reg
This commit is contained in:
parent
e504e9b88e
commit
d808c9a5c3
1 changed files with 3 additions and 7 deletions
|
|
@ -36,13 +36,9 @@ def blender_register_classes():
|
||||||
def blender_unregister_classes():
|
def blender_unregister_classes():
|
||||||
for cls in reversed(_bpy_class_registry):
|
for cls in reversed(_bpy_class_registry):
|
||||||
try:
|
try:
|
||||||
if hasattr(cls, "is_registered") and cls.is_registered: # type: ignore
|
|
||||||
bpy.utils.unregister_class(cls)
|
bpy.utils.unregister_class(cls)
|
||||||
elif hasattr(cls, "bl_rna"):
|
except Exception:
|
||||||
# Fallback for classes that don't have is_registered (older Blender or certain types)
|
pass
|
||||||
bpy.utils.unregister_class(cls)
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Nodeslicer: Failed to unregister {cls}: {e}")
|
|
||||||
|
|
||||||
# TIMERS
|
# TIMERS
|
||||||
def register_timer(clb: Callable[..., Any]):
|
def register_timer(clb: Callable[..., Any]):
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue