diff --git a/__init__.py b/__init__.py index 3f77719..3a0fad8 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,6 @@ import bpy from . import operators, properties, ui, functions from .functions import read_shelves -from .properties import CustomShelfProps, CustomShelfSettings if "bpy" in locals(): import importlib @@ -40,7 +39,6 @@ bl_classes = [ operators.CSHELF_OT_open_shelf_folder, operators.CSHELF_OT_add_script, operators.CSHELF_OT_set_tag_filter, - operators.CustomShelfAddonPreferences, ui.CSHELF_MT_text_editor, ] @@ -51,12 +49,13 @@ def draw_menu(self, context: bpy.types.Context): def register(): for bl_class in bl_classes: + print(f"register {bl_class}") bpy.utils.register_class(bl_class) - # bpy.types.Scene.CustomShelf = bpy.props.PointerProperty(type=CustomShelfSettings) - # bpy.types.WindowManager.CustomShelf = bpy.props.PointerProperty( - # type=CustomShelfProps - # ) + bpy.types.Scene.CustomShelf = bpy.props.PointerProperty(type=properties.CustomShelfSettings) + bpy.types.WindowManager.CustomShelf = bpy.props.PointerProperty( + type=properties.CustomShelfProps + ) bpy.types.TEXT_MT_editor_menus.append(draw_menu) @@ -78,15 +77,15 @@ def register(): def unregister(): # unregister panel : - for panel in CustomShelfSettings.panel_list: + for panel in properties.CustomShelfSettings.panel_list: try: bpy.utils.unregister_class(panel) except Exception: pass bpy.types.TEXT_MT_editor_menus.remove(draw_menu) - # del bpy.types.Scene.CustomShelf - # del bpy.types.WindowManager.CustomShelf + del bpy.types.Scene.CustomShelf + del bpy.types.WindowManager.CustomShelf for bl_class in bl_classes: bpy.utils.unregister_class(bl_class) diff --git a/operators.py b/operators.py index 5c0de00..2225f52 100644 --- a/operators.py +++ b/operators.py @@ -392,13 +392,3 @@ class CSHELF_OT_add_script(Operator): bl_props.tab_enum = tab return context.window_manager.invoke_props_dialog(self, width=500) - - -#class TagFilterItem(PropertyGroup): -# value: StringProperty(name="Tag") - - -class CustomShelfAddonPreferences(AddonPreferences): - bl_idname = __name__ - - #tag_filter_items: CollectionProperty(type=TagFilterItem)