procedure within procedure.???
hi People.....
please know this is my second script and am also trying to understand MEL a bit better.......
i'm trying to capture the changing moment of keyed 0-1 attribute ......
this because i am trying to add a second input device to my motion capture file
it is for an art project......
the idea is to create an animation, and set it as a clip in the trax editor
then capture the moment when state of the object changes (for now a keyed object)
take the current frame and set the start of the clip in the trax editor
and add the length of the animation to set the stop of the animation
this way i can controll my test person with the kinect 360 sensor
and start stop animations that are connected to the rig whenever the second input device changes the state of my input............
since the second device is not yet connected, my question only concerns the noticing and starting stopping the animation inside Maya
this script provides me now with every frame, the current frame and the previous frames as values, and shows the state of the object
but when i now add an if / else the script crashes.......
if i create a second procedure i cannot acces the $curFrame value, or at least i do not know how....
here is a link to the file i use to test the changing state of the object....
www.ieoie.nl/downloads/0000_FLOW_EXPRESSION.zip
can someone show a way out of this situation......;-)
thank you.....
Rob...
global proc RT_Check ()
{
// expres. on locator runs every frame this procedure... "RT_Check ()"
spaceLocator ;
rename |locator1 "tracker01" ;
addAttr -ln "expr_Pull_Frame" -at long |tracker01;
setAttr -e-keyable true |tracker01.expr_Pull_Frame;
int $curFrame =`currentTime -q` ;
int $prevFrame = $curFrame - 1 ;
print ($prevFrame + " Previous \n") ;
print ($curFrame + " Current \n") ;
print "\n" ;
select -r tracker01 ;
delete ;
int $trackCheck01 = `getAttr pSphere1.inP01` ;
print ($trackCheck01 + " Visible Status \n") ;
print "\n" ;
//if ( $trackCheck01 == 1 ) { print "Green \n" }
//else { print "Red \n" }
}