fix imports

This commit is contained in:
Joseph HENRY 2025-12-03 16:53:18 +01:00
parent e26cc4f09f
commit 880dc72057
4 changed files with 25 additions and 21 deletions

View File

@ -1,19 +1,19 @@
import os
import bpy
from . import operators, properties, ui, functions
from .functions import read_shelves
from .properties import CustomShelfProps, CustomShelfSettings
if "bpy" in locals():
import importlib
importlib.reload(operators)
importlib.reload(panels)
importlib.reload(functions)
importlib.reload(properties)
_ = importlib.reload(operators)
# _ = importlib.reload(panels)
_ = importlib.reload(functions)
_ = importlib.reload(properties)
from .functions import read_shelves
from . import operators
from . import properties
from . import ui
from .properties import CustomShelfSettings, CustomShelfProps
import bpy
import os
bl_info = {
"name": "Custom Shelf",
@ -45,7 +45,7 @@ bl_classes = [
]
def draw_menu(self, context):
def draw_menu(self, context: bpy.types.Context):
self.layout.menu("CSHELF_MT_text_editor")
@ -54,9 +54,9 @@ def register():
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.WindowManager.CustomShelf = bpy.props.PointerProperty(
# type=CustomShelfProps
# )
bpy.types.TEXT_MT_editor_menus.append(draw_menu)
@ -85,8 +85,8 @@ def unregister():
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

@ -1,8 +1,11 @@
from os import scandir
from posixpath import splitext
from .utils import *
from bpy.props import *
from bpy.types import Panel, Operator
from .properties import CustomShelfSettings, CustomShelfPrefs
from .Types import *
from os.path import join, dirname, exists
SHELF_DIR = join(dirname(__file__), "shelves")

View File

@ -394,11 +394,11 @@ class CSHELF_OT_add_script(Operator):
return context.window_manager.invoke_props_dialog(self, width=500)
class TagFilterItem(PropertyGroup):
value: StringProperty(name="Tag")
#class TagFilterItem(PropertyGroup):
# value: StringProperty(name="Tag")
class CustomShelfAddonPreferences(AddonPreferences):
bl_idname = __name__
tag_filter_items: CollectionProperty(type=TagFilterItem)
#tag_filter_items: CollectionProperty(type=TagFilterItem)

View File

@ -1,5 +1,6 @@
from .utils import *
from bpy.props import *
from os.path import join, dirname
class CustomShelfSettings(bpy.types.PropertyGroup):