PDA

View Full Version : Hide/Unhide Array?


StevieMac
10-01-2008, 10:58 PM
Hi Guys,

I've been using the script below & I've had a problem trying to get the particles to appear when i need them to. For the shot I'm doing there's a few people crumbling at different times, if i add the script to the Birth Script op & tell it to start at frame 20 in the Emit Start options for the op, the particles don't appear unless I enter 0 into the Emit Start.
So I then added an Age Test & turn the Display op to show no geomatry to get the particles to move on & appear at a certain frame in the enxt event but this didn't work either.

To get around it i used a blend material to make the particles disapear using an opacity in one of the slots, but this means a diferent blend material for each person crumbling & its getting complicated with key frames all over the place. Also because the particles are still in the scene but hidden using the opacity they were still casting shadows & affecting atmosphere effects.


What do I need to add to the script to say when I want the particles to start/appear?

Is there a way to hide & unhide particles that are used in an array like in the script?

Is there a way to start a PFlow system then in the middle hide it then unhide it?



Cheers lads


Stevie



-- Grabs objects into a collection and re-distributes into a particle system
-- Allan McKay 2005/08/23


on ChannelsUsed pCont do
(
pcont.usetm = true
pcont.useshape = true
)

on Init pCont do
(
global FragIce = $FX_ICE_FRAG_* as array
)

on Proceed pCont do
(
t1 = pCont.getTimeStart() as float
t2 = pCont.getTimeEnd() as float

if ((t1 <= 0) and (t2 >= 0)) then
(
(
pcont.addparticles FragIce.count
for i in 1 to FragIce.count do
(
pcont.particleindex = i
pcont.particleshape = FragIce[i].mesh
pcont.particletm = FragIce[i].transform
)
)
)
)

on Release pCont do
(
gc()
)

JonathanFreisler
10-02-2008, 12:27 AM
Yeah, scripts like that need to be calculated form 0. What I would do is put a 'send out' in the birth script event, sending it to a new event with a static material in the new event. Just load in some 100% clear no glossy, blank material, then put an age test in, set it to 20, and send them in the new event add to a new event that has a new material static (dynamic whatever you’re using) with the final ice texture in it.

StevieMac
10-02-2008, 02:18 AM
Thanks for the reply Jon yeah thats an easier way around things! Thanks

BUT this doesn't fix the fact that the particles are still casting shadows & affecting atmosphere effects before they are supposed to. Maybe use a Matte material instead of opacity to fix this?

Any other ideas?

Thanks for the help

Stevie

OlegB
10-02-2008, 02:53 AM
Keep in mind that the Render operator does not have to be in the main global event. While it's in the global event, it forces to render particles in all events. Whereas you can remove Render operator from the global event, and place it in the local events on the need-to-show basis.

Thanks,
Oleg B.

StevieMac
10-02-2008, 06:33 AM
Wow thanks man that looks like it'll work, I never knew you or thought about doing that which is funny because I've use the same technique with Afterburn.

Cheers guys, hope I can return the favour one day.

Stevie

CGTalk Moderation
10-02-2008, 06:33 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.