Hi everyone,
this is my first post. (sorry for my english)
I’m starting to study mel and I’m trying to create my first “snap ik/fk” script.
I’m trying to trigger the script via attribute with the scriptjob command.
until now i wrote this:
proc snap_L_IkLeg_on_L_FkLeg()
{
int $val = getAttr "l_leg_global_ctrl.snap"
;
$l_foot_fk = xform -query -worldSpace -translation l_foot_fk
;
xform -worldSpace -translation $l_foot_fk[0] $l_foot_fk[1] $l_foot_fk[2] l_foot_CTRL;
…
…
.
}
int $scriptJobNum = scriptJob -attributeChange "l_leg_global_ctrl.snap" "snap_L_IkLeg_on_L_FkLeg"
;
I would like the script to work only when “l_leg_global_ctrl.snap” is equal to 1 (or another enum value…)
and not only -attributeChange.
I understood that I have to use a condition to do this, but I can’t figure out how.
From the maya guide I didn’t understand much
I tried to search for any suggestions, but i didn’t found anything useful…
can anyone help me please?