fix: fix unregister error in virtools group

- fix del attribute error when unregister virtools group.
This commit is contained in:
yyc12345 2024-03-30 16:12:34 +08:00
parent b039dd8b43
commit 6cf2ab895d

View File

@ -405,14 +405,14 @@ def register() -> None:
bpy.utils.register_class(BBP_OT_clear_virtools_groups) bpy.utils.register_class(BBP_OT_clear_virtools_groups)
bpy.utils.register_class(BBP_PT_virtools_groups) bpy.utils.register_class(BBP_PT_virtools_groups)
# add into scene metadata # add into object metadata
bpy.types.Object.virtools_groups = bpy.props.CollectionProperty(type = BBP_PG_virtools_group) bpy.types.Object.virtools_groups = bpy.props.CollectionProperty(type = BBP_PG_virtools_group)
bpy.types.Object.active_virtools_groups = bpy.props.IntProperty() bpy.types.Object.active_virtools_groups = bpy.props.IntProperty()
def unregister() -> None: def unregister() -> None:
# del from scene metadata # del from object metadata
del bpy.types.Scene.active_virtools_groups del bpy.types.Object.active_virtools_groups
del bpy.types.Scene.virtools_groups del bpy.types.Object.virtools_groups
bpy.utils.unregister_class(BBP_PT_virtools_groups) bpy.utils.unregister_class(BBP_PT_virtools_groups)
bpy.utils.unregister_class(BBP_OT_clear_virtools_groups) bpy.utils.unregister_class(BBP_OT_clear_virtools_groups)