View Full Version : Sequential visibility
12 December 2005, 03:17 PM
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.
12 December 2005, 08: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.
12 December 2005, 09: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.
12 December 2005, 10: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.
12 December 2005, 11:47 PM
Here it is, he agrees as long as I say it's his script.
12 December 2005, 11:48 PM
And by the way, thanks again for your explanation.
12 December 2005, 12:39 AM
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.
12 December 2005, 09:57 AM
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.
12 December 2005, 07:51 PM
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!
12 December 2005, 08:57 AM
Thanks for the feedback ascent, it's great to know that someone found the expression useful!
12 December 2005, 08: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.