PDA

View Full Version : maya equivalent of xsi scripted operator


grossoftimage
08-12-2007, 07:43 PM
what is the maya equivalent of scrpted operator . i tried with expressions but the expression only runs when i press the play button or frame is changed . and the xsi scripted operator refresh when any input parameter is changed


bye and sorry for my english

sp0rk3d
08-15-2007, 01:54 AM
i have never used xsi but from what it sounds like, you want an expression to evaluate when the playback is stoped...

you can link the expression to the node thru an attribute that you create for example:

i have a pCube1 and a locator1 and i want an attr on the cube called "match" when it is 0 i want it to do nothing when it is 1 i want the cube to be where the locator is. so if i put this in to the expression editor it only works when i move the timeline

if(pCube1.match == 1)
{
float $blah[3]=`xform -q -ws -t locator1`;
xform -ws -t $blah[0] $blah[1] $blah[2] pCube1;
}

so what you can do to fix this so that it updatess when the timeline is not moving is connect the expression to the node in question by adding a new attr like "matchExp" then modify the expression like this:

pCube1.matchExp = pCube1.match;
if(pCube1.matchExp == 1)
{
float $blah[3]=`xform -q -ws -t locator1`;
xform -ws -t $blah[0] $blah[1] $blah[2] pCube1;
}


what you end up with are 2 attrs that seemingly do the same thing one channel will be purple (matchExp in my example) becuase it is directly linked to the expression. This is how the expression knows when the attr's value changes without the timeline changing... if the extra attr annoys you when you are animating you could always lock and hide the purple channel and it should still work

hope that helps
-matt

CGTalk Moderation
08-15-2007, 01:54 AM
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.