PDA

View Full Version : item.getXXX(Time) ignoring argument


ardee
01-20-2005, 07:39 PM
It seems the rotation/position/pivot getters for items (like e.g. in "MyItem.getPosition( 0 )") always return the respective value for the current time regardless of the time argument passed in. At least that's what they're doing for me. Verified for 8.0.1 and 8.2.

ArtHowe
01-21-2005, 03:51 PM
Hey there Ardee,

The following works for me:

@script motion
@warnings
@version 2.7

myCam;

create: obj
{
myCam = obj;
setdesc(".getXXX() Test");
}

process: ma, frame, time
{
zeroFrame = myCam.getPosition(0);
thirtyFrame = myCam.getPosition(1.0);
sixtyFrame = myCam.getPosition(2.0);

info("<br>Frame Zero: ",zeroFrame," Frame Thirty: ",thirtyFrame," Frame Sixty: ",sixtyFrame);
}

ardee
01-21-2005, 07:50 PM
Hey thanks, that solved two issues for me in one go. My mistake was that of not setting up things in the create routine. I don't understand why this is important (i.e. why the object reference does not work when only assigned from the option method) and the documentation does not say anything useful here, but it's working and that matters. Thanks alot.

GregMalick
01-25-2005, 04:31 PM
MyItem.getPosition( time ) works fine for me as long as MyItem is a valid object. You can establish it anwhere - but remember it must me a Global to be accessible in all UDF's.

It sounds like you have a logic problem to me...

Try inserting info( MyItem.name, time, MyItem.getPosition( time ) ); and varying the time variable. That ought to help uncover your problem.