@@ -363,7 +363,7 @@ def create_def(self, tweaks):
363
363
364
364
# Rubber hose drivers
365
365
pb = self .obj .pose .bones
366
- for i ,t in enumerate ( tweaks [1 :- 1 ] ):
366
+ for i , t in enumerate (tweaks [1 :- 1 ]):
367
367
# Create custom property on tweak bone to control rubber hose
368
368
name = 'rubber_tweak'
369
369
@@ -406,18 +406,18 @@ def create_def(self, tweaks):
406
406
def create_ik (self , parent ):
407
407
org_bones = self .org_bones
408
408
409
- bpy .ops .object .mode_set (mode = 'EDIT' )
409
+ bpy .ops .object .mode_set (mode = 'EDIT' )
410
410
eb = self .obj .data .edit_bones
411
411
412
412
ctrl = get_bone_name (org_bones [0 ], 'ctrl' , 'ik' )
413
413
mch_ik = get_bone_name (org_bones [0 ], 'mch' , 'ik' )
414
414
mch_target = get_bone_name (org_bones [0 ], 'mch' , 'ik_target' )
415
415
416
- for o , ik in zip ( org_bones , [ ctrl , mch_ik , mch_target ] ):
417
- bone = copy_bone ( self .obj , o , ik )
416
+ for o , ik in zip (org_bones , [ctrl , mch_ik , mch_target ] ):
417
+ bone = copy_bone (self .obj , o , ik )
418
418
419
- if org_bones .index (o ) == len ( org_bones ) - 1 :
420
- eb [ bone ].length /= 4
419
+ if org_bones .index (o ) == len (org_bones ) - 1 :
420
+ eb [bone ].length /= 4
421
421
422
422
# Create MCH Stretch
423
423
mch_str = copy_bone (
@@ -687,6 +687,13 @@ def create_leg(self, bones):
687
687
else :
688
688
leg_parent = None
689
689
690
+ mch_name = get_bone_name (strip_org (org_bones [0 ]), 'mch' , 'parent_socket' )
691
+ mch_main_parent = copy_bone (self .obj , org_bones [0 ], mch_name )
692
+ eb [mch_main_parent ].length = eb [org_bones [0 ]].length / 12
693
+ eb [mch_main_parent ].parent = eb [bones ['parent' ]]
694
+ eb [mch_main_parent ].roll = 0.0
695
+ eb [bones ['main_parent' ]].parent = eb [mch_main_parent ]
696
+
690
697
# Create heel ctrl bone
691
698
heel = get_bone_name (org_bones [2 ], 'ctrl' , 'heel_ik' )
692
699
heel = copy_bone (self .obj , org_bones [2 ], heel )
@@ -948,6 +955,10 @@ def create_leg(self, bones):
948
955
'max_y' : 1.05 ,
949
956
'owner_space' : 'LOCAL'
950
957
})
958
+ make_constraint (self , mch_main_parent , {
959
+ 'constraint' : 'COPY_ROTATION' ,
960
+ 'subtarget' : org_bones [0 ]
961
+ })
951
962
952
963
# Create ik/fk switch property
953
964
pb_parent = pb [bones ['main_parent' ]]
@@ -1481,7 +1492,7 @@ def parameters_ui(layout, params):
1481
1492
1482
1493
row = col .row (align = True )
1483
1494
1484
- for i in range (16 ,24 ):
1495
+ for i in range (16 , 24 ):
1485
1496
icon = "NONE"
1486
1497
if bone_layers [i ]:
1487
1498
icon = "LAYER_ACTIVE"
@@ -1490,15 +1501,15 @@ def parameters_ui(layout, params):
1490
1501
col = r .column (align = True )
1491
1502
row = col .row (align = True )
1492
1503
1493
- for i in range (8 ,16 ):
1504
+ for i in range (8 , 16 ):
1494
1505
icon = "NONE"
1495
1506
if bone_layers [i ]:
1496
1507
icon = "LAYER_ACTIVE"
1497
1508
row .prop (params , layer + "_layers" , index = i , toggle = True , text = "" , icon = icon )
1498
1509
1499
1510
row = col .row (align = True )
1500
1511
1501
- for i in range (24 ,32 ):
1512
+ for i in range (24 , 32 ):
1502
1513
icon = "NONE"
1503
1514
if bone_layers [i ]:
1504
1515
icon = "LAYER_ACTIVE"
0 commit comments