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

Working.....;-)

The Maya file is empty. And right off the bat the last if then lines are going to throw a syntax error as soon as you comment them in because the statements are inside curly brackets yet are missing semi colons. My suggestion is, until your totally comfortable with MEL, make better use of white space so it's easier to pick up on these mistakes. And adding more comments wouldn't hurt user added image

before

Code:
if ( $trackCheck01 == 1 ) { print "Green \n" }
else { print "Red \n" }
after

Code:
if ( $trackCheck01 == 1 ) { 

print "Green \n"; 

}else { 

print "Red \n";

}
Also, you can create another procedure that you pass the variable(s) to.

like:

Code:
global proc doThisStuff(int $curFrame){


print $curFrame;
//and do other stuff


}
If you need to pass multiple variables then just separete them by commas and remember to define the data type(int, string etc). You can even send a mix of data types.

The RT_Check proc can call it.


Code:
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";

	} 

	//// call new proc and pass variable
	doThisStuff($curFrame);


}
Hopefully that helped. I'll stop rambling now user added image



it sure did help... thank you.....
please keep rambing.... i love it.....;-)
ps, the scene wasn't empty... there was just 1 sphere in it,... the input i forgot to connect to the visibility of the sphere....oeps....sry
;-)

i tried the red dotcomma thingy, did not work earlier,
but you adding the extra curly bracket in the end did the trick i think.... am i right here.....???
like you have to close 2 procedures in stead of one???

getting the vallue in the next procedure i will try later, when needed......
thank you so much.....
me is verry happy now.....

enjoy....


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

all are welcome at www.ieoie.nl