PDA

View Full Version : Select Objects in sequence.


Notum
01-15-2004, 09:51 AM
Hey guys.
I need help with a script thing.

In plain text I want the script to do the following:

Go through each selected object and set visibility to 0 for 5 frames, then set visibility to 1. Then offset the animation 5 frames from the previous object.

ie:
Object N-01: Frame 0 = Vis0
Frame 5 = Vis1

object N-02: Frame 5 = Vis0
Frame 10 = Vis1

etc etc.... :)

Can anyone help me with this?

Thanks

magicm
01-16-2004, 10:58 AM
Assuming you have the following objects in your scene:

      TestObject01
      TestObject02
      etc..

-- variable <fr> holds the current frame
fr = 0
-- loop through all objects named "TestObject*"
for obj in $TestObject* do
(
&nbsp;&nbsp;&nbsp;&nbsp;-- set animate on so following statements will create keys
&nbsp;&nbsp;&nbsp;&nbsp;animate on
&nbsp;&nbsp;&nbsp;&nbsp;(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-- create two visiblity keys
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at time fr obj.visibility = 0
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at time (fr+5) obj.visibility = 1
&nbsp;&nbsp;&nbsp;&nbsp;)
-- advance <fr> variable for next object
fr += 5
)

Hope this helps,
Martijn

Notum
01-16-2004, 11:28 AM
thanks magicm :)

that did the trick :)

CGTalk Moderation
01-17-2006, 05:00 AM
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.