@@ -148,7 +148,7 @@ def generate(self):
148
148
def_bone_e .parent = eb [self .org_bones [i ]].parent
149
149
def_bone_e .use_connect = False
150
150
# First mch bone
151
- mch_bone_e .parent = eb [ self . org_bones [ i ]]. parent
151
+ mch_bone_e .parent = ctrl_bone_e
152
152
mch_bone_e .use_connect = False
153
153
# First mch driver bone
154
154
mch_bone_drv_e .parent = eb [self .org_bones [i ]].parent
@@ -196,30 +196,30 @@ def generate(self):
196
196
con .subtarget = mch
197
197
198
198
# Constraining the deform bones
199
- con = pb [deform ].constraints .new ('COPY_TRANSFORMS' )
200
- con .target = self .obj
201
- con .subtarget = org
202
-
203
- # Constraining the mch bones
204
- if mch_chain .index (mch ) == 0 :
205
- con = pb [mch ].constraints .new ('COPY_LOCATION' )
199
+ if deform == def_chain [0 ]:
200
+ con = pb [deform ].constraints .new ('COPY_LOCATION' )
206
201
con .target = self .obj
207
- con .subtarget = ctrl
202
+ con .subtarget = org
208
203
209
- con = pb [mch ].constraints .new ('COPY_SCALE' )
204
+ con = pb [deform ].constraints .new ('COPY_SCALE' )
210
205
con .target = self .obj
211
- con .subtarget = ctrl
206
+ con .subtarget = org
212
207
213
- con = pb [mch ].constraints .new ('DAMPED_TRACK' )
208
+ con = pb [deform ].constraints .new ('DAMPED_TRACK' )
214
209
con .target = self .obj
215
- con .subtarget = ctrl_chain [ ctrl_chain . index ( ctrl ) + 1 ]
210
+ con .subtarget = org_bones [ 1 ]
216
211
217
- con = pb [mch ].constraints .new ('STRETCH_TO' )
212
+ con = pb [deform ].constraints .new ('STRETCH_TO' )
218
213
con .target = self .obj
219
- con .subtarget = ctrl_chain [ ctrl_chain . index ( ctrl ) + 1 ]
214
+ con .subtarget = org_bones [ 1 ]
220
215
con .volume = 'NO_VOLUME'
216
+ else :
217
+ con = pb [deform ].constraints .new ('COPY_TRANSFORMS' )
218
+ con .target = self .obj
219
+ con .subtarget = org
221
220
222
- elif mch_chain .index (mch ) == len (mch_chain ) - 1 :
221
+ # Constraining the mch bones
222
+ if mch_chain .index (mch ) == len (mch_chain ) - 1 :
223
223
con = pb [mch ].constraints .new ('DAMPED_TRACK' )
224
224
con .target = self .obj
225
225
con .subtarget = tip_name
0 commit comments