View Single Post
# 1 17-06-2016 , 03:00 PM
Registered User
Join Date: May 2012
Posts: 3

MEL getAttr and setAttr help - Extreme Newby

Hey guys,
I'm a new user to maya and extremely new to MEL. I have a nurbs curve and a gravitational field affecting a particle system. I want to link the direction of graviational field to the roration attributes of nurbs curve. I tried the following in the create new expression tab for "direction" attribute of the gravitational field:
{
float $X = 'getAttr nurbsCircle1.rotateX';
float $Z = 'getAttr nurbsCircle1.rotateZ';

gravityField1.directionX = -1*sind($Z);
gravityField1.directionY = cosd($X)+cosd($Z);
gravityField1.directionZ = sind($X);
}

I get tons of errors:
// Error: float $X = 'getAttr nurbsCircle1.rotateX'; //
// Error: Line 1.12: Syntax error //
// Error: float $Z = 'getAttr nurbsCircle1.rotateZ'; //
// Error: Line 2.12: Syntax error //

Please help user added image