@@ -109,13 +109,22 @@ def generate(self):
109
109
mch_chain += [mch_bone ]
110
110
mch_drv_chain += [mch_bone_drv ]
111
111
112
+ # Creating tip control bone
113
+ tip_name = copy_bone (self .obj , org_bones [- 1 ], temp_name )
114
+ ctrl_bone_tip = eb [tip_name ]
115
+ flip_bone (self .obj , tip_name )
116
+ ctrl_bone_tip .length /= 2
117
+
118
+ ctrl_bone_tip .parent = eb [ctrl_chain [- 1 ]]
119
+
112
120
# Restoring org chain parenting
113
121
for bone in org_bones [1 :]:
114
122
eb [bone ].parent = eb [org_bones [org_bones .index (bone ) - 1 ]]
123
+ eb [bone ].use_connect = True
115
124
116
- # Parenting the master bone to the first org
125
+ # Parenting the master bone parallel to the first org
117
126
ctrl_bone_master = eb [master_name ]
118
- ctrl_bone_master .parent = eb [org_bones [0 ]]
127
+ ctrl_bone_master .parent = eb [org_bones [0 ]]. parent
119
128
120
129
# Parenting chain bones
121
130
for i in range (len (self .org_bones )):
@@ -153,14 +162,6 @@ def generate(self):
153
162
mch_bone_e .parent = ctrl_bone_e
154
163
mch_bone_e .use_connect = False
155
164
156
- # Creating tip control bone
157
- tip_name = copy_bone (self .obj , org_bones [- 1 ], temp_name )
158
- ctrl_bone_tip = eb [tip_name ]
159
- flip_bone (self .obj , tip_name )
160
- ctrl_bone_tip .length /= 2
161
-
162
- ctrl_bone_tip .parent = eb [ctrl_chain [- 1 ]]
163
-
164
165
bpy .ops .object .mode_set (mode = 'OBJECT' )
165
166
166
167
pb = self .obj .pose .bones
@@ -183,11 +184,15 @@ def generate(self):
183
184
184
185
# Pose settings
185
186
for org , ctrl , deform , mch , mch_drv in zip (self .org_bones , ctrl_chain , def_chain , mch_chain , mch_drv_chain ):
187
+ # Constraining the org bones
188
+ con = pb [org ].constraints .new ('COPY_TRANSFORMS' )
189
+ con .target = self .obj
190
+ con .subtarget = mch
186
191
187
192
# Constraining the deform bones
188
193
con = pb [deform ].constraints .new ('COPY_TRANSFORMS' )
189
194
con .target = self .obj
190
- con .subtarget = mch
195
+ con .subtarget = org
191
196
192
197
# Constraining the mch bones
193
198
if mch_chain .index (mch ) == 0 :
0 commit comments