Lee, Andrew Hickinbottom (3D) Tank Girl, Pedro Conti (2D)

View Full Version : cv’s expression…

11-05-2003, 10:46 AM
Hi all,

in which way may I express a cv/vx in the expression editor? Because I’m trying to do this simple assignment:

nurbsSphereShape1.cv[6][0].ty = 12;

and I’ve the following error message:

// Error: Attributes must be of float, integer, or boolean types: controlPoints //

Thanks for any suggestions

11-06-2003, 10:29 AM
I’ve understood the use of setAttr and getAttr for setting and getting cv’s values; my next question is: when I try to put a cv’s coordinates in an array writing:

float $cvXYZ [] = getAttr("nurbsSphereShape1.cv[6][0]");

and then simply printing these values:

print ($cvXYZ [0]);
print ($cvXYZ [1]);
print ($cvXYZ [2]);

the script editor shows the follow result:

000// Result: expression1 //

that instead should be 060, and this happens for every cv’s that I pass to getAttr. Any explanation for this behaviour?
My general purpose in this expression is to constraint a shape x,y,z position to the cv[6][0] position of the another shape; so, I’d to get the cv position using getAttr, and place these values in a array ($cvXYZ []), then I’d make the following assignment:

objShape1.tx = $cvXYZ [0];
objShape1.ty = $cvXYZ [1];
objShape1.tz = $cvXYZ [2];

Thanks for any suggestions :-)

09-07-2004, 11:55 AM
i don't know if I understand well but if you want the CV's position you can use the command:

pointPosition curve1.cv[3];

Returns the (x,y,z) world position of curve1's 3rd CV.

09-07-2004, 11:58 AM
Ok, thanks

09-07-2004, 02:22 PM

and the values are tweaks on history (curves mildly special case, but same when they have history).

CGTalk Moderation
01-16-2006, 02:00 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.