PDA

View Full Version : how to implement this wrong expression


f117f117f117677
04-18-2006, 08:09 AM
how to implement this wrong expression ,by right way.

body_control.translateZ = ( -rfoot.translateY - lfoot.translateY ) / 2
body_control.translateZ = ( rfoot.translateY + lfoot.translateY ) / 2


i have used this way,but it didn't work
if ( ( rfoot.translateY + lfoot.translateY ) >= 0 )
{
body_control.translateZ = ( -rfoot.translateY - lfoot.translateY ) / 2;

}
else
{
body_control.translateZ = ( rfoot.translateY + lfoot.translateY ) / 2;
}

Soulcialism
04-18-2006, 05:18 PM
i'm not sure if this is your problem or not, but you are not using correct MEL in this expression.

if you want to make body_control.translateZ = something, you must use setAttr.

example:
setAttr body_control.translateZ = ...

does that help?

Segmoria
04-18-2006, 09:38 PM
Yes you can use "body_control.translateZ = something" since this is an expression and not a MEL script.

But there doesn't seem to be any problem, at least syntax-wise, with your above expression.
I tried it myself in the expression editor and it evaluates with no problems.

What error does it give you?

f117f117f117677
04-19-2006, 03:21 PM
Yes you can use "body_control.translateZ = something" since this is an expression and not a MEL script.

But there doesn't seem to be any problem, at least syntax-wise, with your above expression.
I tried it myself in the expression editor and it evaluates with no problems.

What error does it give you?

my error is that "body_control.translateZ = ( -rfoot.translateY - lfoot.translateY ) / 2" does
work ,but the other one not.

thank you

CGTalk Moderation
04-19-2006, 03:21 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.