|
@@ -0,0 +1,142 @@
|
|
|
+# ----------------------------------------------------------
|
|
|
+# File __init__.py
|
|
|
+# ----------------------------------------------------------
|
|
|
+
|
|
|
+# Imports
|
|
|
+# Check if this add-on is being reloaded
|
|
|
+if "bpy" in locals():
|
|
|
+ # reloading .py files
|
|
|
+ import bpy
|
|
|
+ import importlib
|
|
|
+
|
|
|
+ from . import zs_renderscene as zsrs
|
|
|
+
|
|
|
+ importlib.reload(zsrs)
|
|
|
+ from . import zs_masterscene as zsms
|
|
|
+
|
|
|
+ importlib.reload(zsms)
|
|
|
+ from . import zs_renderscene as zsu
|
|
|
+
|
|
|
+ importlib.reload(zsu)
|
|
|
+
|
|
|
+ from . import zs_anvil
|
|
|
+
|
|
|
+ importlib.reload(zs_anvil)
|
|
|
+
|
|
|
+ from . import zs_deadline
|
|
|
+
|
|
|
+ importlib.reload(zs_deadline)
|
|
|
+
|
|
|
+ from . import zs_light_linking
|
|
|
+
|
|
|
+ importlib.reload(zs_light_linking)
|
|
|
+
|
|
|
+
|
|
|
+# or if this is the first load of this add-on
|
|
|
+else:
|
|
|
+ import bpy
|
|
|
+ import json
|
|
|
+ from pathlib import Path
|
|
|
+
|
|
|
+ from . import zs_masterscene as zsms # noqa
|
|
|
+
|
|
|
+ from . import zs_renderscene as zsrs # noqa
|
|
|
+
|
|
|
+ from . import zs_renderscene as zsu # noqa
|
|
|
+
|
|
|
+ from . import zs_anvil
|
|
|
+
|
|
|
+ from . import zs_deadline
|
|
|
+
|
|
|
+ from . import zs_light_linking
|
|
|
+
|
|
|
+
|
|
|
+# Addon info
|
|
|
+bl_info = {
|
|
|
+ "name": "ZS Stable Diffusion Connection V0.0.1",
|
|
|
+ "author": "Sergiu <sergiu@zixelise.com>",
|
|
|
+ "Version": (0, 0, 1),
|
|
|
+ "blender": (4, 00, 0),
|
|
|
+ "category": "Scene",
|
|
|
+ "description": "Stable Diffusion Connection",
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+# -------------------------------------------------------------------
|
|
|
+# UI Functions
|
|
|
+# -------------------------------------------------------------------
|
|
|
+
|
|
|
+
|
|
|
+# -------------------------------------------------------------------
|
|
|
+# Operators
|
|
|
+# -------------------------------------------------------------------
|
|
|
+
|
|
|
+
|
|
|
+# parent class for panels
|
|
|
+class ZSSDPanel:
|
|
|
+ bl_space_type = "VIEW_3D"
|
|
|
+ bl_region_type = "UI"
|
|
|
+ bl_category = "ZS Scene Manager"
|
|
|
+
|
|
|
+
|
|
|
+# -------------------------------------------------------------------
|
|
|
+# Draw
|
|
|
+# -------------------------------------------------------------------
|
|
|
+
|
|
|
+# Panels
|
|
|
+
|
|
|
+
|
|
|
+class ZSSD_PT_Main(ZSSDPanel, bpy.types.Panel):
|
|
|
+ bl_label = "SD Loader"
|
|
|
+
|
|
|
+ def draw(self, context):
|
|
|
+ layout = self.layout
|
|
|
+
|
|
|
+ scene = context.scene
|
|
|
+
|
|
|
+ col = layout.column()
|
|
|
+
|
|
|
+ self.is_connected = False
|
|
|
+
|
|
|
+ col.label(text="Stable Diffusion Connection")
|
|
|
+
|
|
|
+
|
|
|
+# modify after making products
|
|
|
+blender_classes = [
|
|
|
+ ZSSD_PT_Main,
|
|
|
+]
|
|
|
+
|
|
|
+
|
|
|
+def register():
|
|
|
+
|
|
|
+ # register classes
|
|
|
+ for blender_class in blender_classes:
|
|
|
+ bpy.utils.register_class(blender_class)
|
|
|
+
|
|
|
+ # Has to be after class registering to correctly register property
|
|
|
+ bpy.types.Scene.zs_ll_parameters = bpy.props.CollectionProperty(
|
|
|
+ type=zs_light_linking.ZS_LL_Parameter, name="Light Linking Parameters"
|
|
|
+ )
|
|
|
+
|
|
|
+ # register global properties
|
|
|
+
|
|
|
+ # register list
|
|
|
+
|
|
|
+ # list data
|
|
|
+
|
|
|
+ # bpy.types.Scene.zs_product_list = bpy.props.CollectionProperty(
|
|
|
+ # type=ZS_Product_ListItem)
|
|
|
+
|
|
|
+ # current item in list
|
|
|
+
|
|
|
+
|
|
|
+def unregister():
|
|
|
+
|
|
|
+ # unregister classes
|
|
|
+ for blender_class in blender_classes:
|
|
|
+ bpy.utils.unregister_class(blender_class)
|
|
|
+ # unregister global properties
|
|
|
+
|
|
|
+ # unregister list items
|
|
|
+ # del bpy.types.Scene.my_list
|
|
|
+ # del bpy.types.Scene.product_product_list_index
|