-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
__init__.py
93 lines (75 loc) · 2.75 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# Yes, i'm aware the code of this plugin is really messy, and no, i won't fix it. I won't waste my time restructuring a plugin that nobody uses, sorry
import bpy
# Updater
from . import (
addon_updater_ops,
armature_creation,
armature_rename,
constraint_symmetry,
ops,
preferences,
props,
ui,
utils,
weight_armature,
)
bl_info = {
"name": "Source Armature Toolkit",
"author": "Haggets",
"version": (1, 0, 0),
"blender": (2, 93, 2),
"location": "Properties > Object Data (Armature)",
"description": "Various utilities to ease the work while working with Source engine armatures.",
"url": "https://github.com/Haggets/source-armature-toolkit",
"wiki_url": "https://github.com/Haggets/source-armature-toolkit",
"tracker_url": "https://github.com/Haggets/source-armature-toolkit/issues",
"category": "Armature",
}
classes = [
props.SAT_properties,
props.SAT_info,
preferences.SAT_preferences,
ui.SAT_PT_mainpanel,
ui.SAT_PT_armaturerename,
ui.SAT_PT_constraintsymmetry,
ui.SAT_PT_weightarmature,
ui.SAT_PT_rigifyretarget,
ui.SAT_PT_rigifyretargetexport,
ops.SAT_OT_create_armature,
ops.SAT_OT_convert_armature,
ops.SAT_OT_armaturerename_blender,
ops.SAT_OT_armaturerename_source,
ops.SAT_OT_constraintsymmetry_create,
ops.SAT_OT_constraintsymmetry_delete,
ops.SAT_OT_constraintsymmetry_apply,
ops.SAT_OT_weightarmature_create,
ops.SAT_OT_weightarmature_delete,
ops.SAT_OT_rigifyretarget_create,
ops.SAT_OT_rigifyretarget_delete,
ops.SAT_OT_rigifyretarget_generate_and_link,
ops.SAT_OT_rigifyretarget_bake_single,
ops.SAT_OT_rigifyretarget_bake_all,
ops.SAT_OT_rigifyretarget_export_all,
]
def register():
# Registers addon updater
addon_updater_ops.register(bl_info)
# Registers everything else
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.satproperties = bpy.props.PointerProperty(type=props.SAT_properties)
bpy.types.Scene.satinfo = bpy.props.PointerProperty(type=props.SAT_info)
bpy.app.handlers.load_post.append(utils.create_armature)
bpy.app.handlers.undo_post.append(utils.armatures_reset)
bpy.app.handlers.redo_post.append(utils.armatures_reset)
def unregister():
addon_updater_ops.unregister()
for cls in classes:
bpy.utils.unregister_class(cls)
bpy.app.handlers.load_post.remove(utils.create_armature)
bpy.app.handlers.undo_post.remove(utils.armatures_reset)
bpy.app.handlers.redo_post.remove(utils.armatures_reset)
del bpy.types.Scene.satproperties
del bpy.types.Scene.satinfo
if __name__ == "__main__":
register()