Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 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.
# 2 20-05-2015 , 12:04 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095


everything starts and ends in the right place at the right time.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads