PDA

View Full Version : newbie question



kurant
08-09-2003, 08:37 AM
I just started on a Item animation script, in which I need to take the motion from one objekt, perform some calculations on it, ant apply to another object. what I dont know, is how to read the motion channels from the object the plugin is not assigned to.
any help is appreciated.

faulknermano
08-10-2003, 10:20 AM
you have to get the Mesh Object Agent of that particular item first.




myItem = Mesh("myTargetItem");
pos = myItem.getPosition(Scene().currenttime);
rot = myItem.getRotation(Scene().currenttime);
// get the channels

chan = myItem.firstChannel();
while(chan)
{
if(chan.name == "Position.X")
chanPosX = chan;
if(chan.name == "Position.Y")
chanPosY = chan;
if(chan.name == "Position.Z")
chanPosZ = chan;
chan = myItem.nextChannel();
}

kurant
08-10-2003, 03:06 PM
thanks :)