CGTalk > Software > Maxon Cinema 4D
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 12-16-2005, 03:17 PM   #1
salvazalvi
New Member
Salvador Zalvidea
Paris, France
 
Join Date: Dec 2005
Posts: 7
Sequential visibility

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
 
Old 12-17-2005, 08:19 AM   #2
Darter
Positive buoyancy
 
Darter's Avatar
David Wickenden
Ballina, Australia
 
Join Date: Nov 2003
Posts: 1,227
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.

Last edited by Darter : 12-17-2005 at 10:06 PM.
 
Old 12-17-2005, 09:38 AM   #3
salvazalvi
New Member
Salvador Zalvidea
Paris, France
 
Join Date: Dec 2005
Posts: 7
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
 
Old 12-17-2005, 10:04 PM   #4
Darter
Positive buoyancy
 
Darter's Avatar
David Wickenden
Ballina, Australia
 
Join Date: Nov 2003
Posts: 1,227
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.

Last edited by Darter : 12-18-2005 at 12:38 AM. Reason: Modulo option added to expression
 
Old 12-17-2005, 11:47 PM   #5
salvazalvi
New Member
Salvador Zalvidea
Paris, France
 
Join Date: Dec 2005
Posts: 7
Here it is, he agrees as long as I say it's his script.

Salvador
Attached Files
File Type: zip on-off.c4d.zip (32.9 KB, 54 views)
 
Old 12-17-2005, 11:48 PM   #6
salvazalvi
New Member
Salvador Zalvidea
Paris, France
 
Join Date: Dec 2005
Posts: 7
And by the way, thanks again for your explanation.

Salvador
 
Old 12-18-2005, 12:39 AM   #7
Darter
Positive buoyancy
 
Darter's Avatar
David Wickenden
Ballina, Australia
 
Join Date: Nov 2003
Posts: 1,227
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.
 
Old 12-19-2005, 09:57 AM   #8
salvazalvi
New Member
Salvador Zalvidea
Paris, France
 
Join Date: Dec 2005
Posts: 7
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
 
Old 12-23-2005, 07:51 PM   #9
unseenthings
Where's my hasenfeffer??
portfolio
Gregory Dunn
3D Illustrator
Unseen Things
USA
 
Join Date: Feb 2003
Posts: 668
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!
 
Old 12-24-2005, 08:57 AM   #10
Darter
Positive buoyancy
 
Darter's Avatar
David Wickenden
Ballina, Australia
 
Join Date: Nov 2003
Posts: 1,227
Thanks for the feedback ascent, it's great to know that someone found the expression useful!
 
Old 12-24-2005, 08:57 AM   #11
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:15 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.