View Single Post
# 1 20-05-2015 , 10:29 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

expression via mel

Ahoi,


I have a question concerning expressions via mel script. for some reason it seems to work - no errors... but no expression is being written into the locators. (i have particle called pLetter_Zero. then want to figure out the particle-count, create as many locators and place them to each particle via expression)

any input is much appreciated!



int $partCount = `getAttr ("pLetter_Zero" + ".count") `;

for( $i=0; $i<$partCount; $i++ ) {

spaceLocator -n ("pLocator" + $i);
string $particleLocator[] = `ls -sl`;

string $exprX = ($particleLocator[0] + ".tx");
string $exprY = ($particleLocator[0] + ".ty");
string $exprZ = ($particleLocator[0] + ".tz");


string $cmd = " \
float $particlePos[] = `particle -id $i -at worldPosition -q pLetter_Zero`; \n\
$exprX = $particlePos[0]; \n\
$exprY = $particlePos[1]; \n\
$exprZ = $particlePos[2]; \n\
";

expression -s $cmd;

}


everything starts and ends in the right place at the right time.

Last edited by Falott; 20-05-2015 at 11:07 AM.