@@ -109,13 +109,22 @@ def generate(self):
109109 mch_chain += [mch_bone ]
110110 mch_drv_chain += [mch_bone_drv ]
111111
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+
112120 # Restoring org chain parenting
113121 for bone in org_bones [1 :]:
114122 eb [bone ].parent = eb [org_bones [org_bones .index (bone ) - 1 ]]
123+ eb [bone ].use_connect = True
115124
116- # Parenting the master bone to the first org
125+ # Parenting the master bone parallel to the first org
117126 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
119128
120129 # Parenting chain bones
121130 for i in range (len (self .org_bones )):
@@ -153,14 +162,6 @@ def generate(self):
153162 mch_bone_e .parent = ctrl_bone_e
154163 mch_bone_e .use_connect = False
155164
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-
164165 bpy .ops .object .mode_set (mode = 'OBJECT' )
165166
166167 pb = self .obj .pose .bones
@@ -183,11 +184,15 @@ def generate(self):
183184
184185 # Pose settings
185186 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
186191
187192 # Constraining the deform bones
188193 con = pb [deform ].constraints .new ('COPY_TRANSFORMS' )
189194 con .target = self .obj
190- con .subtarget = mch
195+ con .subtarget = org
191196
192197 # Constraining the mch bones
193198 if mch_chain .index (mch ) == 0 :
0 commit comments