27
27
from .utils import unique_name
28
28
from .utils import upgradeMetarigTypes , outdated_types
29
29
from .utils import get_keyed_frames
30
+ from .utils import overwrite_prop_animation
30
31
from .rigs .utils import get_limb_generated_names
31
32
from . import rig_lists
32
33
from . import generate
@@ -651,8 +652,14 @@ def draw(self, context):
651
652
row .operator ("rigify.clear_animation" , text = "Clear FK Action" , icon = 'CANCEL' ).type = "FK"
652
653
653
654
row = self .layout .row (align = True )
654
- row .operator ("rigify.rotation_pole" , icon = 'NONE' , text = 'Toggle IK rotation-pole' )
655
-
655
+ op = row .operator ("rigify.rotation_pole" , icon = 'SCRIPTWIN' , text = 'Switch to pole' )
656
+ op .value = True
657
+ op .toggle = False
658
+ op .bake = True
659
+ op = row .operator ("rigify.rotation_pole" , icon = 'SCRIPTWIN' , text = 'Switch to rotation' )
660
+ op .value = False
661
+ op .toggle = False
662
+ op .bake = True
656
663
row = self .layout .row (align = True )
657
664
row .prop (id_store , 'rigify_transfer_start_frame' )
658
665
row .prop (id_store , 'rigify_transfer_end_frame' )
@@ -902,6 +909,10 @@ def FktoIk(rig, window='ALL'):
902
909
fk_ctrl = names ['fk_ctrl' ]
903
910
parent = names ['parent' ]
904
911
pole = names ['pole' ]
912
+ rig .pose .bones [controls [0 ]].bone .select = True
913
+ rig .pose .bones [ik_ctrl [1 ]].bone .select = True
914
+ rig .pose .bones [controls [4 ]].bone .select = True
915
+ rig .pose .bones [pole ].bone .select = True
905
916
kwargs = {'uarm_fk' : controls [1 ], 'farm_fk' : controls [2 ], 'hand_fk' : controls [3 ],
906
917
'uarm_ik' : controls [0 ], 'farm_ik' : ik_ctrl [1 ], 'hand_ik' : controls [4 ],
907
918
'pole' : pole , 'main_parent' : parent }
@@ -912,7 +923,11 @@ def FktoIk(rig, window='ALL'):
912
923
fk_ctrl = names ['fk_ctrl' ]
913
924
parent = names ['parent' ]
914
925
pole = names ['pole' ]
915
-
926
+ rig .pose .bones [controls [0 ]].bone .select = True
927
+ rig .pose .bones [ik_ctrl [1 ]].bone .select = True
928
+ rig .pose .bones [controls [6 ]].bone .select = True
929
+ rig .pose .bones [controls [5 ]].bone .select = True
930
+ rig .pose .bones [pole ].bone .select = True
916
931
kwargs = {'thigh_fk' : controls [1 ], 'shin_fk' : controls [2 ], 'foot_fk' : controls [3 ],
917
932
'mfoot_fk' : controls [7 ], 'thigh_ik' : controls [0 ], 'shin_ik' : ik_ctrl [1 ],
918
933
'foot_ik' : controls [6 ], 'pole' : pole , 'footroll' : controls [5 ], 'mfoot_ik' : ik_ctrl [2 ],
@@ -964,6 +979,9 @@ def IktoFk(rig, window='ALL'):
964
979
fk_ctrl = names ['fk_ctrl' ]
965
980
parent = names ['parent' ]
966
981
pole = names ['pole' ]
982
+ rig .pose .bones [controls [1 ]].bone .select = True
983
+ rig .pose .bones [controls [2 ]].bone .select = True
984
+ rig .pose .bones [controls [3 ]].bone .select = True
967
985
kwargs = {'uarm_fk' : controls [1 ], 'farm_fk' : controls [2 ], 'hand_fk' : controls [3 ],
968
986
'uarm_ik' : controls [0 ], 'farm_ik' : ik_ctrl [1 ],
969
987
'hand_ik' : controls [4 ]}
@@ -974,6 +992,9 @@ def IktoFk(rig, window='ALL'):
974
992
fk_ctrl = names ['fk_ctrl' ]
975
993
parent = names ['parent' ]
976
994
pole = names ['pole' ]
995
+ rig .pose .bones [controls [1 ]].bone .select = True
996
+ rig .pose .bones [controls [2 ]].bone .select = True
997
+ rig .pose .bones [controls [3 ]].bone .select = True
977
998
kwargs = {'thigh_fk' : controls [1 ], 'shin_fk' : controls [2 ], 'foot_fk' : controls [3 ],
978
999
'mfoot_fk' : controls [7 ], 'thigh_ik' : controls [0 ], 'shin_ik' : ik_ctrl [1 ],
979
1000
'foot_ik' : ik_ctrl [2 ], 'mfoot_ik' : ik_ctrl [2 ]}
@@ -1103,6 +1124,8 @@ def rotPoleToggle(rig, window='ALL', value=False, toggle=False, bake=False):
1103
1124
if bake :
1104
1125
bpy .ops .anim .keyframe_insert_menu (type = 'BUILTIN_KSI_VisualLocRot' )
1105
1126
bpy .ops .anim .keyframe_insert_menu (type = 'Scaling' )
1127
+ overwrite_prop_animation (rig , rig .pose .bones [parent ], 'pole_vector' , new_pole_vector_value ,
1128
+ [f ])
1106
1129
limb_generated_names .pop (group )
1107
1130
break
1108
1131
scn .frame_set (0 )
0 commit comments