>>>
From:
owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of guillaume laforge
Sent: 1-Nov-06 17:12
To: XSI(at)Softimage.COM
Subject: scripting - current frame
returned but...
Good evening,
I am blocked by a simple thing in a scripted operator. The SCOP controls local
transformations and I need to set an initial state at frame 1.
So I use something like below and it doesn't want to work at frame 1 ( in this
example the object should be at 0,0,0 in position at frame 1 and it is at
5,5,5...).
var CF =
In_UpdateContext.CurrentFrame;
CF = Math.round(CF); // At this point CF is becomes a jscript
number and not an XSI variant
var oInitialState = XSIMath.CreateTransform();
if(CF == 1) // Not
CF.Value
{
oInitialState.SetIdentity();//juste to be 100% sure
oInitialState is 0,0,0 in position...
Out.Value.Transform = oInitialState;
}
else
{
oInitialState.SetTranslationFromValues (5, 5, 5);
Out.Value.Transform = oInitialState;
}
Did I miss something really simple ?
Cheers
--
Guillaume Laforge
freelance TD | cg Artist
my blog ! http://vol2blog.blogspot.com/