Re: scripting - current frame returned but...

Date : Wed, 1 Nov 2006 14:17:08 -0800
To : XSI(at)Softimage.COM
From : "Ben Barker" <ben.barker(at)gmail.com>
Subject : Re: scripting - current frame returned but...
I pass in the current frame as a parameter to the scripted op and then
set that parameter to have an expression of "Fc". So it would be
In_UpdateContext.parameters("currentFrame").value instead.

On 11/1/06, guillaume laforge <guillaume.laforge.3d(at)gmail.com> wrote:
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);

var oInitialState = XSIMath.CreateTransform();
if(CF.Value == 1)
{
    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/


--
Ben Barker
Character TD
CafeFX
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.