PDA

View Full Version : unhide objects


danielw74
06-17-2008, 12:19 PM
Im having problems to unhide objects in a particle script test.

I hide the objects that i use as geometry in the birthscript, and want to unhide them when i delete the particles. i have a scripttest to test that all particles have returned to the original position, and in that scripttest i unhide. all works fine in the viewport but when i render the unhide command in the scripttest dosent work.

Bobo
06-17-2008, 03:40 PM
Im having problems to unhide objects in a particle script test.

I hide the objects that i use as geometry in the birthscript, and want to unhide them when i delete the particles. i have a scripttest to test that all particles have returned to the original position, and in that scripttest i unhide. all works fine in the viewport but when i render the unhide command in the scripttest dosent work.

Hiding/Freezing objects dynamically is NOT supported by the renderer. The hidden state of the objects is evaluated only once at the beginning of a render sequence because Max assumes that the hidden state cannot change mid-animation (as it is not keyframeable). This limitation (or optimization, if you want) was imposed in days when there was no scripting in Max. This also means that the scene evaluation is performed just once and if nothing changes, nothing has to be recalculated (this was something that worked even in 3d Studio Dos).

So you cannot perform hiding inside a script and expect your objects to disappear. What you can do though is control the value of the Visibility track which IS animatable and evaluated by the renderer on each frame.

danielw74
06-17-2008, 04:40 PM
thanks for the reply Bobo.

ah.. :blush: why didn't i think about that, now i have keyframed the visibility track going from 1 to 0 on specific frames.

but anyway.. it dosent work.

in the birth script i put the line "chunksarray.visibility = 0" and it works, all my chamferboxes get Visibility = 0. but when it comes to the scripttest and the line "chunksarray.visibility = 1" it wont work. have even tryed to print the chunksarray in the scripttest and it works, still the same objects thats in the birthscript.

it would be grate to get some solution of this, so i dont have to keyframe all visibility tracks of my chunks, cuse it gets slow when its 1178 objects.

-- thanks

supremepizza
06-17-2008, 06:15 PM
Animate the opacity of your material by particle age.
Set the animation curve to "step".

Bobo
06-17-2008, 09:51 PM
thanks for the reply Bobo.

ah.. :blush: why didn't i think about that, now i have keyframed the visibility track going from 1 to 0 on specific frames.

but anyway.. it dosent work.

in the birth script i put the line "chunksarray.visibility = 0" and it works, all my chamferboxes get Visibility = 0. but when it comes to the scripttest and the line "chunksarray.visibility = 1" it wont work. have even tryed to print the chunksarray in the scripttest and it works, still the same objects thats in the birthscript.

it would be grate to get some solution of this, so i dont have to keyframe all visibility tracks of my chunks, cuse it gets slow when its 1178 objects.

-- thanks

Do the visibility tracks have CONTROLLERS assigned to them? The renderer will evaluate the visibility only if it is ANIMATED (using so-called validity intervals, Max skips anything that does not change over time).

The trouble is that you cannot create Keys during the playback of the script, so you would have to probably use an external script that sets the keyframes for each object based on the particle life (see my PFlow Baking script for Max 2009)

Alternatively, you could move and/or scale to 0,0,0 the objects out of sight when they have to be hidden.

CGTalk Moderation
06-17-2008, 09:51 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.