PDA

View Full Version : Sequential visibility


salvazalvi
12-16-2005, 02:17 PM
Hi,

This is a newby question :
I would like to have several objet in a group to appear each frame by frame (one after the other). I've been using the visibility tag and animating it, but for hundreds of objects I think an expression would do it faster. As I don't know XPresso I'm a bit stuck.
I think one solution would be to write an expression that says :

Object(index2)visibility=100 if object(index1)visibility=100 at time-1frame.

I then set the visibility for the first object in my group and voilà.

But how to do that in Xpresso ?

Any advice is welcome.

Thanks,

Salvador

Darter
12-17-2005, 07:19 AM
Here's an expression for automatically switching visibility. Visibility duration in frames is set via User Data and the effect can be inverted. Just put your objects under the null and hit play.

EDIT: Expression updated. See below.

salvazalvi
12-17-2005, 08:38 AM
Thank you very much Darter.

I see I've not been clear enough. What your script does is switch visibility on and off for one frame, what I want is the first object to appear on frame 1, the second on frame 2 while the object stays visible and so on till all my objects are visible. But as I'm quite a beginner, I would like you, if you have time, to explain me how your expression works.

I've been speaking with base80 who wrote me another expression that does it. I don't know if I'm allowed to post it here, but if you want it I can ask him.

Thanks again,

Salvador

Darter
12-17-2005, 09:04 PM
No problem, I’ve added a setting for cumulative visibility switching so that it works as described.

The current frame is divided by the Duration value and rounded down to an integer by the FloatFunc node. When an object’s index equals this value (determined by the Compare node), its visibility is switched. The ‘Cumulative’ User Data setting changes Compare node’s function from = = to <= so that an object’s visibility will remain switched on/off for the rest of the sequence. The Modulo node keeps the Frame/Duration output between 0 and the object count so that visibility switching will cycle until the end of the frame sequence.

I'd be interested in seeing how base80 has approached the problem if he's happy for you to post the file.

salvazalvi
12-17-2005, 10:47 PM
Here it is, he agrees as long as I say it's his script.

Salvador

salvazalvi
12-17-2005, 10:48 PM
And by the way, thanks again for your explanation.

Salvador

Darter
12-17-2005, 11:39 PM
I hope that the explanation makes sense.

I've updated the file to include a Modulo option so that this function can be turned off if desired. You may not need the various extra options but hopefully they make the expression useful in a wider range of situations.

salvazalvi
12-19-2005, 08:57 AM
Hi,

Explanation makes sense but I have to admit Xpresso is a bit complicated for me and I wouldn't be able to write such an expression at my level of understanding.

Coming from a more synthetic syntax in AE expressions wich I use for simple tasks, Xpresso nodes request a sort of "twisted" way of thinking I don't have yet. But it kindda reminds me when switching for the first time to Shake or orher nodebased compositing systems.


Thanks,

Salvador

unseenthings
12-23-2005, 06:51 PM
Darter:
That xpression worked really great when I was trying to import an series of files exported from Blender's fluid simulation. (series of obj)

Once I get a little more elegant solution for doing it (rather than importing and arranging all the obj's by hand) I'll post in the main forum... other people may be interested.

But in any case, thanks for sharing!

Darter
12-24-2005, 07:57 AM
Thanks for the feedback ascent, it's great to know that someone found the expression useful!

CGTalk Moderation
12-24-2005, 07:57 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.