Re: scripting - current frame returned but...
| Date : Thu, 2 Nov 2006 00:14:06 +0100 |
| To : XSI(at)Softimage.COM |
| From : "guillaume laforge" <guillaume.laforge.3d(at)gmail.com> |
| Subject : Re: scripting - current frame returned but... |
Cheers
Guillaume
Make sure the scop is set to "Always update". Since there is no input, or none of the inputs is dirty, the scop doesn't get automatically updated on frame change.
- ½
From: owner-xsi(at)Softimage.COM [mailto: owner-xsi(at)Softimage.COM] On Behalf Of guillaume laforge
Sent: 1-Nov-06 17:55
To: XSI(at)Softimage.COM
Subject: Re: scripting - current frame returned but...
> Your if statement is testing CF.Value, not CF.
A mistake...thanks Stephen.
But even with the correct value ( CF ) it doesn't work.
In fact it works only once like a standard script.
If a click "Apply" in the script operator editor at frame 1 then the object position is set to 0,0,0.
If I click "Apply" at an other frame it is set to 5,5,5. But if I hit play for example, it doesn't update.On 11/1/06, Stephen Blair < Stephen_Blair(at)softimage.com> wrote:
Hi
Your if statement is testing CF.Value, not CF.
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of guillaume laforge
Sent: Wed 01 November 2006 5:34 PM
To: XSI(at)Softimage.COM
Subject: Re: scripting - current frame returned but...Thanks Ben,
I also used a custom parameter with an "Fc" _expression_ in the past but I'm just curious to know why it doesn't work like this with "In_UpdateContext.CurrentFrame;" as XSI logged the correct frame ???
On 11/1/06, Ben Barker <ben.barker(at)gmail.com> wrote:
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
--
Guillaume Laforge
freelance TD | cg Artist
my blog ! http://vol2blog.blogspot.com/
- References:
- RE: scripting - current frame returned but...
- From: "Halfdan Ingvarsson" <hingvars(at)Softimage.COM>
- RE: scripting - current frame returned but...
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: Help with Python
- Next by Date: Re: Help with Python
- Previous by Thread: Re: Help with Python
- Next by Thread: Re: Help with Python
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |