[Closed] adding a key button for custom attributes
Hey,
I am in the process of rigging a character. I added some customAttributes for limb controls, I wanted to add a key all button which keys all the custom attributes on the current frame. This works but partially. I used the “addnewkey()” function. This does not set a key when I open the file and press my “Key All” button. But in case i animate the parameter(s) it then later does allow me to set keys. I’m pasting the code. To get what i’m saying, please select any object, Add the PEN_Attribute_Holder and run the code.
Thanks a lot in advance guys,
Vikram.
--ca = custattributes.getdef $.modifiers[1].handLControls
ca=attributes handLControls
--redefine:ca
(
parameters param2 rollout:handLfkik
(
fkikL type:#float ui:fkikLsp
fkikslL type:#float ui:fkikslLsp
)
parameters param10 rollout:shoulderL
(
shoulL type:#float ui:shoulLsp
)
parameters param8 rollout:allfing
(
allfingL1 type:#float ui:allfingL1sp
allfingL2 type:#float ui:allfingL2sp
)
parameters param9 rollout:reset
(
resetp type:#point3 ui:resetpbtnL
)
rollout Lhandrour "Left Hand Controls"
(
label lb1 "Please work with smooth and"
label lb2 "highlight mode with edged faces"
label lb3 "off to see right effect of controls"
)
rollout Lhandkeyall "Key All"
(
button btnkeyall "Key All"
on btnkeyall pressed do
(
addnewkey $.modifiers[#PEN_Attribute_Holder_2].handLControls currenttime
)
)
rollout handLfkik "FK / IK"
(
spinner fkikLsp "FK/IK" range:[0,10,0]
slider fkikslLsp "FK________________IK" range:[0,10,0]
label lbfkikL "Value 0 means FK"
)
rollout shoulderL "Shoulder Controls"
(
spinner shoulLsp "Shoulder follow" range:[0,10,6]
label lb1 "Works with the IK mode only"
)
rollout allfing "All finger Controls"
(
spinner allfingL1sp "All fingers splay" range:[-1,5,0]
spinner allfingL2sp "All fingers curl" range:[-1,8,0]
)
rollout reset "Reset position"
(
button resetpbtnL "Reset Position"
label lb4 "Only for the IK hand controller"
on resetpbtnL pressed do
(
--temphand_posL = $hipgirl_he_hand_pos_L.pos
--$hipgirl_ctrl_ik_hand_L.pos = temphand_posL
)
)
)
custattributes.add $.modifiers[1] ca
Hi guys,
Sorry but this is a reminder post. I havent got a solution to my problem so if somebody could help me please.
Thanks
hi vicky
There could be etter ways but this works for me:
after the last line of your code, where you add the cust attrib to the modifier,
assign controllers to all the animatable parameters.
example:
custattributes.add $.modifiers[1] ca
ss = $.modifiers[1].handLControls
ss.fkikL.controller = (Bezier_Float())
ss.allfingL1.controller = (Bezier_Float())
ss.resetp.controller = (bezier_point3())
------ .... and so on