PDA

View Full Version : accessing data on keyframed objects


j-mation
04-22-2007, 08:08 AM
I not sure if I'm missing something about the way Lscript works. Is there a difference between accessing positional data when an object has more than one keyframe and a single keyframe.

When I use the info() command to display this data on a single frame I get the correct x,y,z settings for that frame but if have more than one keyframe I can only access the x,y,z data of the very last keyframe. Is this a lightwave bug or am I missing some wierd Lscript method.

jeremyhardin
04-23-2007, 05:58 AM
doesn't sound right. what kind of script is this? Item Animation?

And do you have any code snippets?

j-mation
04-23-2007, 08:36 AM
I've been writing it as a generic script. I'm writing the position data to a text file. below is a simpler version of what I've been doing.

@version 2.2
@warnings
@script generic

// global values go here

generic
{
thisScene=Scene();
mySelection=thisScene.getSelect();
Myrange=25;
for(i=1; i<=Myrange;i++)
{
info(mySelection[1].getPosition(i).x);
}
}

faulknermano
04-25-2007, 05:15 AM
hehehe...... :D

the problem is that you're feeding a frame range to getPosition(). it should be a time index. thus:

info(mySelection[1].getPosition(i/Scene().fps).x);