This commit is contained in:
Joseph HENRY 2025-12-03 17:19:22 +01:00
parent 483c35d1bf
commit c873214fcc
2 changed files with 8 additions and 19 deletions

View File

@ -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)

View File

@ -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)