fix imports
This commit is contained in:
parent
e26cc4f09f
commit
880dc72057
36
__init__.py
36
__init__.py
@ -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():
|
if "bpy" in locals():
|
||||||
import importlib
|
import importlib
|
||||||
|
|
||||||
importlib.reload(operators)
|
_ = importlib.reload(operators)
|
||||||
importlib.reload(panels)
|
# _ = importlib.reload(panels)
|
||||||
importlib.reload(functions)
|
_ = importlib.reload(functions)
|
||||||
importlib.reload(properties)
|
_ = 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 = {
|
bl_info = {
|
||||||
"name": "Custom Shelf",
|
"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")
|
self.layout.menu("CSHELF_MT_text_editor")
|
||||||
|
|
||||||
|
|
||||||
@ -54,9 +54,9 @@ def register():
|
|||||||
bpy.utils.register_class(bl_class)
|
bpy.utils.register_class(bl_class)
|
||||||
|
|
||||||
bpy.types.Scene.CustomShelf = bpy.props.PointerProperty(type=CustomShelfSettings)
|
bpy.types.Scene.CustomShelf = bpy.props.PointerProperty(type=CustomShelfSettings)
|
||||||
bpy.types.WindowManager.CustomShelf = bpy.props.PointerProperty(
|
# bpy.types.WindowManager.CustomShelf = bpy.props.PointerProperty(
|
||||||
type=CustomShelfProps
|
# type=CustomShelfProps
|
||||||
)
|
# )
|
||||||
|
|
||||||
bpy.types.TEXT_MT_editor_menus.append(draw_menu)
|
bpy.types.TEXT_MT_editor_menus.append(draw_menu)
|
||||||
|
|
||||||
@ -85,8 +85,8 @@ def unregister():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
bpy.types.TEXT_MT_editor_menus.remove(draw_menu)
|
bpy.types.TEXT_MT_editor_menus.remove(draw_menu)
|
||||||
del bpy.types.Scene.CustomShelf
|
# del bpy.types.Scene.CustomShelf
|
||||||
del bpy.types.WindowManager.CustomShelf
|
# del bpy.types.WindowManager.CustomShelf
|
||||||
|
|
||||||
for bl_class in bl_classes:
|
for bl_class in bl_classes:
|
||||||
bpy.utils.unregister_class(bl_class)
|
bpy.utils.unregister_class(bl_class)
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
|
from os import scandir
|
||||||
|
from posixpath import splitext
|
||||||
from .utils import *
|
from .utils import *
|
||||||
from bpy.props import *
|
from bpy.props import *
|
||||||
from bpy.types import Panel, Operator
|
from bpy.types import Panel, Operator
|
||||||
from .properties import CustomShelfSettings, CustomShelfPrefs
|
from .properties import CustomShelfSettings, CustomShelfPrefs
|
||||||
from .Types import *
|
from .Types import *
|
||||||
|
from os.path import join, dirname, exists
|
||||||
|
|
||||||
|
|
||||||
SHELF_DIR = join(dirname(__file__), "shelves")
|
SHELF_DIR = join(dirname(__file__), "shelves")
|
||||||
|
|||||||
@ -394,11 +394,11 @@ class CSHELF_OT_add_script(Operator):
|
|||||||
return context.window_manager.invoke_props_dialog(self, width=500)
|
return context.window_manager.invoke_props_dialog(self, width=500)
|
||||||
|
|
||||||
|
|
||||||
class TagFilterItem(PropertyGroup):
|
#class TagFilterItem(PropertyGroup):
|
||||||
value: StringProperty(name="Tag")
|
# value: StringProperty(name="Tag")
|
||||||
|
|
||||||
|
|
||||||
class CustomShelfAddonPreferences(AddonPreferences):
|
class CustomShelfAddonPreferences(AddonPreferences):
|
||||||
bl_idname = __name__
|
bl_idname = __name__
|
||||||
|
|
||||||
tag_filter_items: CollectionProperty(type=TagFilterItem)
|
#tag_filter_items: CollectionProperty(type=TagFilterItem)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
from .utils import *
|
from .utils import *
|
||||||
from bpy.props import *
|
from bpy.props import *
|
||||||
|
from os.path import join, dirname
|
||||||
|
|
||||||
|
|
||||||
class CustomShelfSettings(bpy.types.PropertyGroup):
|
class CustomShelfSettings(bpy.types.PropertyGroup):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user