PDA

View Full Version : Using condition expression on multiple objects


boazsunim
05-05-2011, 05:25 PM
Hey guys,

Basically what I am after is a way of running the following expression on multiple objects ...

if( polySurface2.rotateZ < 179 )
polySurface2.visibility = 1 ; else polySurface2.visibility = 0




so here is the mel command that give me Syntax error :

for($n in `ls -sl`)
{

expression -s ($n + ".visibility = if( " + $n + ".rotate < 179 ) { "
+ $n + ".visibility = 1 ) else " + $n + ".visibility = 0 };")
-o $n -ae 1 -uc all ;
};


Many thanks in advance.....

boz.

mduvekot
05-05-2011, 07:15 PM
for($n in `ls -sl`) {
expression -s ("if (" + $n + ".rotateX < 179)\n\t " + $n + ".visibility = 1;\nelse \n\t" + $n + ".visibility = 0;\n") -o $n -ae 1 -uc all ;
}

boazsunim
05-05-2011, 07:56 PM
Thank you so much! It works now!

boz.

CGTalk Moderation
05-05-2011, 07:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.