Execute a script on each frame change

Discussions concerning programming of SOFTIMAGE©
Post Reply
User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 02:56
Location: Montréal, QC, Canada
Contact:

Execute a script on each frame change

Post by claudevervoort » 13 May 2010, 22:03

Hi!

I wanted to do a simple script to alter an object based on a couple of things (including distance traversed since last frame). The script is simple, but where do I wire it?

That sound easy, but then I dug around, and where I am now is that it seems I should create actually create a command from the script, and modify the playback option to execute that command on each frame change.

Seems more that what I bargained for, so is there another way to do it (in my naive thinking I thought i'd be able to attach the script to the object to be evaluated on each frame change).

(BTW this can easily be done with ICE Kinematics, just this is for a 7.0 release, and also my own exercise to understand a bit more of the scripting in Softimage).

Thanks for any idea!

Claude

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Execute a script on each frame change

Post by Hirazi Blue » 14 May 2010, 08:44

Not sure, but wouldn't a "scripted operator" be able to do just that?
Stay safe, sane & healthy!

User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 02:56
Location: Montréal, QC, Canada
Contact:

Re: Execute a script on each frame change

Post by claudevervoort » 14 May 2010, 14:03

Thanks Hirazi, I'll look at that and let you know.

Claude

User avatar
claudevervoort
Posts: 89
Joined: 16 Oct 2009, 02:56
Location: Montréal, QC, Canada
Contact:

Re: Execute a script on each frame change

Post by claudevervoort » 14 May 2010, 23:02

That worked for me :) Turns out you cannot evaluate at another frame from within an operator (which I think makes sense) but I was able to store previous frame data in the UserData which is far more efficient anyway.

Claude

Post Reply

Who is online

Users browsing this forum: No registered users and 64 guests