kopia lustrzana https://github.com/hc-psy/blender-gpt
[fix] register prevent re-registering
rodzic
3e82d05f37
commit
f0210aee44
|
@ -23,6 +23,7 @@ Classes = (BLENDERGPT_PT_PANEL, BLENDERGPT_OT_DEL_ALL_MSG, BLENDERGPT_OT_DEL_MSG
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
for cls in Classes:
|
for cls in Classes:
|
||||||
|
if cls.__name__ not in bpy.types.__dict__:
|
||||||
bpy.utils.register_class(cls)
|
bpy.utils.register_class(cls)
|
||||||
|
|
||||||
props_initialization()
|
props_initialization()
|
||||||
|
@ -30,6 +31,7 @@ def register():
|
||||||
|
|
||||||
def unregister():
|
def unregister():
|
||||||
for cls in Classes:
|
for cls in Classes:
|
||||||
|
if cls.__name__ in bpy.types.__dict__:
|
||||||
bpy.utils.unregister_class(cls)
|
bpy.utils.unregister_class(cls)
|
||||||
|
|
||||||
props_clear()
|
props_clear()
|
||||||
|
|
Ładowanie…
Reference in New Issue