View Full Version : Velocity and vector
madmikethespoon 12-11-2007, 02:41 AM Ok, I tried searching and couldn’t find what I was looking for. I’m trying to add attributes to an object that gives me vector and velocity of that object. I plan on using these attributes to control the orientation of an object using expressions. my question is how do I create these attributes. I am fairly new at writing expressions and creating attributes, however I have done simple things like creating an RPM (revolutions per minute) attribute. Any help on the subject would be great, thanx.
|
|
r4inm4ker
12-11-2007, 04:42 AM
string $objName= "obj1";
addAttr -ln "velocity" -dt "double3" $objName;
//to set attribute value:
setAttr ($objName+".velocity") -type "double3" 1 0 0;
//to get attribute value:
vector $vel = `getAttr ($objName+".velocity")`;
CGTalk Moderation
12-11-2007, 04:42 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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.