-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
props.py
184 lines (150 loc) · 5.12 KB
/
props.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import bpy
from . import advanced_ik, armature_creation, constraint_symmetry, utils
class SAT_properties(bpy.types.PropertyGroup): #Defines global properties the plugin will use
#Thanks to Jeacom for this
def armature_poll(self, object):
#Generated armatures should not be part of the list
if object.name.endswith('.weight') or object.name.endswith('.anim') or object.name.endswith('.anim_setup'):
pass
else:
return object.type == 'ARMATURE'
#Retuns only meshes
def object_poll(self, object):
return object.type == 'MESH'
target_armature : bpy.props.PointerProperty(
type=bpy.types.Object,
name='Armature',
description="Armature that will be used to perform operations on",
poll=armature_poll,
update=utils.create_armature
)
target_object : bpy.props.PointerProperty(
type=bpy.types.Object,
name='Object',
description="Object linked to the armature that will be used for shapekeys",
poll=object_poll
)
affected_side : bpy.props.EnumProperty(
name="Affected side",
description="Side that will be used for applying symmetry constraints",
items=[
('LTR', "Left Side", "Left to Right"),
('RTL', "Right Side", "Right to Left")
]
)
symmetry_offset : bpy.props.BoolProperty(
name="Symmetry Offset",
description="If disabled, the location of bones will be the opposite of the location of its pair, else its initial locationn ill be unchanged",
default=False,
update=constraint_symmetry.update_constraint
)
symmetry_upperarm_rotation_fix : bpy.props.BoolProperty(
name="Opposite Arm Rotation Fix",
description="If the opposite arm rotates in the wrong direction, enable this",
default=False,
update=constraint_symmetry.update_constraint
)
retarget_constraints : bpy.props.BoolProperty(
name="Retarget Constraints",
description="Used to preview the animation for the armature after baking",
default=True,
update=advanced_ik.retarget_constraints
)
bake_helper_bones : bpy.props.BoolProperty(
name="Bake Helper Bones",
description="Only required for viewmodels",
default=False,
)
#Armature creation selection
game_armature_type : bpy.props.EnumProperty(
name="Type",
description="Armature type",
items=[
('PM', "Playermodel", "World armature"),
('VM', "Viewmodel", "View armature")
],
update=utils.update_armature
)
game_armature : bpy.props.EnumProperty(
name="Game Armature",
description="Create armature from the selected game",
items=[
('HL2', "Half Life 2/Garry's Mod", "Citizen armature"),
('L4D2', "Left 4 Dead 2", "Survivor armatures"),
('SBOX', "S&Box", "Standard S&Box armature"),
],
update=utils.update_armature
)
game_armature_l4d2 : bpy.props.EnumProperty(
name="L4D Survivor Armatures",
description="Selection of survivor armatures",
items=[
('BILL', "Bill", ""),
('FRANCIS', "Francis", ""),
('LOUIS', "Louis", ""),
('ZOEY', "Zoey", ""),
('COACH', "Coach", ""),
('ELLIS', "Ellis", ""),
('NICK', "Nick", ""),
('ROCHELLE', "Rochelle", "")
],
update=utils.update_armature
)
class SAT_info(bpy.types.PropertyGroup):
unit : bpy.props.FloatProperty(
default=0
)
##Operator checks for undos and redos##
creating_armature : bpy.props.BoolProperty(
default=False
)
armature_name : bpy.props.StringProperty(
default=''
)
generated_armature_name : bpy.props.StringProperty(
default=''
)
unconverted_armature : bpy.props.BoolProperty(
default=False
)
symmetry : bpy.props.IntProperty(
default=0
#0 = Neither side, 1 = Left, 2 = Right
)
##Weight armature
weight_armature : bpy.props.BoolProperty(
default=False
)
##Animation armature data##
animation_armature : bpy.props.BoolProperty(
default=False
)
animation_armature_setup : bpy.props.BoolProperty(
default=False
)
##Armature information
prefix : bpy.props.StringProperty(
default=''
)
scheme : bpy.props.IntProperty(
default=0
#-1 = No armature, 0 = Default, 1 = Blender Friendly
)
viewmodel : bpy.props.BoolProperty(
default=False
)
special_viewmodel : bpy.props.BoolProperty(
default=False
)
goldsource : bpy.props.BoolProperty(
default=False
)
titanfall : bpy.props.BoolProperty(
default=False
)
sbox : bpy.props.BoolProperty(
default=False
)
tf2 : bpy.props.BoolProperty(
default=False
)