-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
70 lines (52 loc) · 2.42 KB
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
bl_info = {
"name": "Template Add-on Name",
"description": "Template add-on description.",
"author": "Your Name",
"version": (1, 0, 0),
"blender": (4, 2, 0),
"location": "3D Viewport > N Panel > Hello World",
# "doc_url": "https://github.com/{username}/{repo-name}",
# "tracker_url": "https://github.com/{username}/{repo-name}/issues",
# "warning": "Pre-Release",
"support": "COMMUNITY",
"category": "Choose a category", # Try to fit into an existing category (or use your department's name)
}
"""
Make sure to update package.bat with the path to your Blender executable
"""
# ——————————————————————————————————————————————————————————————————————
# MARK: IMPORTS
# ——————————————————————————————————————————————————————————————————————
# fmt: off
if "bpy" in locals():
from importlib import reload
# Modules to reload during development go here
reload(addon_preferences)
reload(hello_world_module)
else:
# ...and here
from . import addon_preferences
from . import hello_world_module
# ...but not here
import bpy
# fmt: on
# ——————————————————————————————————————————————————————————————————————
# MARK: REGISTRATION
# ——————————————————————————————————————————————————————————————————————
# Classes Blender should know about go in this list
classes = [
addon_preferences.TemplatePreferences,
hello_world_module.HelloWorldProperties,
hello_world_module.TEMPLATE_PT_hello_world_panel,
hello_world_module.TEMPLATE_OT_hello_world_operator,
]
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.hello_world_properties = bpy.props.PointerProperty(type=hello_world_module.HelloWorldProperties)
def unregister():
for cls in reversed(classes):
bpy.utils.unregister_class(cls)
del bpy.types.Scene.hello_world_properties
if __name__ == "__main__":
register()