PDA

View Full Version : How to sequence (offset in time) a bunch of objects?


tfortier
11-11-2006, 01:02 AM
Hi, I was wondering if there's any script for offset in time a bunch of objects like the Sequence Layers in After Effects... by entering an offset value, it will offset all selected layers (objects) by that amount from each others in the selection order...

very usefull for animating typo or bunch of small objects... you animate the first, copy paste the anim on all the others, and offset them in time for make them start one after one...

thanks!
t

misterdi
11-11-2006, 06:22 AM
I'm not too sure whether there is a menu button to do this, but for a quick and dirty solution use SISequence command from a script.

Here is an example:
var oColl = selection;
var tOffset = 0.0;
var offset = 2.0;
for (var i = 0; i<oColl.count; i++)
{
oObj = oColl(i);
tOffset += offset;
SISequence(oObj, siAnimParams, tOffset);
}

SISequence is exactly the same as Sequence which is Modal.

Hope that help.

Regards,

kimaldis
11-11-2006, 02:58 PM
there's a sequence selected object(s) under the animation menu. It doesn't sequence clips though.

misterdi
11-13-2006, 02:03 AM
You are right Kim, except with this button I think you need to do sequence one at a time, it use the same command.

Thanks,

tfortier
11-13-2006, 04:36 AM
mmm... doesnt seem to work for me... the sequence button permit me to offset a bunch of objects by the same amount... not offsetting between them... but thanks for that!

misterdi
11-13-2006, 06:14 AM
That's what I meant with the previous message.

The button will offset a group of object with same offset at one time. So you need to repeat the process while increasing the offset value.

With the script it's handle as tOffset which accumulate the offset every step in the loop.

It will call SISequence command several times as the number object you select, and give tOffset for offsetting the animated parameters.

This will give you what you are looking for.

kimaldis
11-13-2006, 06:39 AM
You are right Kim, except with this button I think you need to do sequence one at a time, it use the same command.

Thanks,

select all your objects then run it?

kimaldis
11-13-2006, 06:40 AM
ah, sorry. Should have read the post more carefully

tfortier
11-14-2006, 08:54 AM
hey misterdi, nice tut on your site! Ill watch them carefully when I will have time!

I cant get the script to works right now... but probably my fault, im a lw user freshly converted! I will ask some pro today at my job, there is 3 xsi scripting guys...

thanks a lot! Ill post my result soon
t

misterdi
11-14-2006, 10:50 AM
My bet, your scripting preference is set to VBScript.
And the code that I send you is a JScript.

You can check on your script preference or use right click inside the script editor to set the language to JScript.

Select your object in order and then hit run to run the script. I use siAnimParams, so I think it will offset all animated parameters in an object.

Regards,

tfortier
12-11-2006, 06:57 PM
Hey MisterDi! your script worked like a charm!

I just had the occasion to test it again and you was right for the jscript pref!

One of the programmer here will do a python version of the script with more features... I will post it when its ready!

thanks a lot for your help! very appreciated.

t

jham77
01-13-2007, 07:50 PM
This script worked very well under 5.11
But it doesn't work with 6.0

Can anybody teach me why...?

Thank you.

misterdi
01-15-2007, 05:36 AM
I haven't tested on 6.0, still working with v5.11 now.
I'll run a test of the script on v6.0 soon.

Regards,

misterdi
01-15-2007, 06:45 AM
Doh!.

Seems like the SISequence command broken in v6.0, could someone report to support.

It might miss the checking during beta cycle.

Regards,

misterdi
01-15-2007, 06:58 AM
For time being until XSI fix the problems with SISequence command, replace that command with "ScaleAndOffset"
var oColl = selection;
var tOffset = 0.0;
var offset = 2.0;
for (var i = 0; i<oColl.count; i++)
{
oObj = oColl(i);
tOffset += offset;
ScaleAndOffset(oObj, siAnimParams, tOffset);
}

Hopefully it works as expected.
You could take a look the difference between SISequence and ScaleAndOffset in the SDK Guides

Cheers

jham77
01-15-2007, 11:37 PM
Hopefully it works as expected.
You could take a look the difference between SISequence and ScaleAndOffset in the SDK Guides

Cheers
Thank you so much Misterdi !!

And for SISequence no working in 6.0,
I hope someone report the SISequence to Softimage.

Thanks again.

-J

CGTalk Moderation
01-15-2007, 11:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.