__init__.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # ----------------------------------------------------------
  2. # File __init__.py
  3. # ----------------------------------------------------------
  4. # Imports
  5. # Check if this add-on is being reloaded
  6. if "bpy" in locals():
  7. # reloading .py files
  8. import bpy
  9. import importlib
  10. from . import zs_renderscene as zsrs
  11. importlib.reload(zsrs)
  12. from . import zs_masterscene as zsms
  13. importlib.reload(zsms)
  14. from . import zs_renderscene as zsu
  15. importlib.reload(zsu)
  16. from . import zs_anvil
  17. importlib.reload(zs_anvil)
  18. from . import zs_deadline
  19. importlib.reload(zs_deadline)
  20. from . import zs_light_linking
  21. importlib.reload(zs_light_linking)
  22. # or if this is the first load of this add-on
  23. else:
  24. import bpy
  25. import json
  26. from pathlib import Path
  27. from . import zs_masterscene as zsms # noqa
  28. from . import zs_renderscene as zsrs # noqa
  29. from . import zs_renderscene as zsu # noqa
  30. from . import zs_anvil
  31. from . import zs_deadline
  32. from . import zs_light_linking
  33. # Addon info
  34. bl_info = {
  35. "name": "ZS Stable Diffusion Connection V0.0.1",
  36. "author": "Sergiu <sergiu@zixelise.com>",
  37. "Version": (0, 0, 1),
  38. "blender": (4, 00, 0),
  39. "category": "Scene",
  40. "description": "Stable Diffusion Connection",
  41. }
  42. # -------------------------------------------------------------------
  43. # UI Functions
  44. # -------------------------------------------------------------------
  45. # -------------------------------------------------------------------
  46. # Operators
  47. # -------------------------------------------------------------------
  48. # parent class for panels
  49. class ZSSDPanel:
  50. bl_space_type = "VIEW_3D"
  51. bl_region_type = "UI"
  52. bl_category = "ZS Scene Manager"
  53. # -------------------------------------------------------------------
  54. # Draw
  55. # -------------------------------------------------------------------
  56. # Panels
  57. class ZSSD_PT_Main(ZSSDPanel, bpy.types.Panel):
  58. bl_label = "SD Loader"
  59. def draw(self, context):
  60. layout = self.layout
  61. scene = context.scene
  62. col = layout.column()
  63. self.is_connected = False
  64. col.label(text="Stable Diffusion Connection")
  65. # modify after making products
  66. blender_classes = [
  67. ZSSD_PT_Main,
  68. ]
  69. def register():
  70. # register classes
  71. for blender_class in blender_classes:
  72. bpy.utils.register_class(blender_class)
  73. # Has to be after class registering to correctly register property
  74. bpy.types.Scene.zs_ll_parameters = bpy.props.CollectionProperty(
  75. type=zs_light_linking.ZS_LL_Parameter, name="Light Linking Parameters"
  76. )
  77. # register global properties
  78. # register list
  79. # list data
  80. # bpy.types.Scene.zs_product_list = bpy.props.CollectionProperty(
  81. # type=ZS_Product_ListItem)
  82. # current item in list
  83. def unregister():
  84. # unregister classes
  85. for blender_class in blender_classes:
  86. bpy.utils.unregister_class(blender_class)
  87. # unregister global properties
  88. # unregister list items
  89. # del bpy.types.Scene.my_list
  90. # del bpy.types.Scene.product_product_list_index