View Single Post
# 1 02-10-2013 , 01:06 PM
ieoie's Avatar
Registered User
Join Date: Aug 2007
Location: The Netherlands
Posts: 88

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" }

}

Attached Files
File Type: txt RT_Check_Question.txt (654 Bytes, 381 views) File Type: zip 0000_FLOW_EXPRESSION.zip (9.1 KB, 382 views)

*
The Universe is larger then you ever can think, But smaller then the size of your imagination.

all are welcome at www.ieoie.nl