PDA

View Full Version : Slowing down particle aging


bobweb
07-24-2007, 09:13 AM
Hello Particle Pirates,

I have the following problem: I want to put particles in slow motion at a certain time. This works quite fine so far, the only thing missing is a working Particle Age map. Since they are in slow motion their age needs to be growing slower as well. Probably this needs to be scripted with a loop for getting all ages and reassigning them again - but unfortunately I have no idea how such a script needs to look like syntax-wise to work. Could anyone help me out?

Thanks,
Bob

bobweb
07-27-2007, 04:04 PM
Well, I have got a starting point so far and it seems to work in a simple test scene but it does not seem to be the best solution. It behaves strangely in the "real" scene, sometimes it works, sometimes not, sometimes only not when rendering... I have made all settings of viewport and render equal. Does anyone have a hint, a better idea, something?

This is the code I have got so far, as I have said, I am not much of a scripter:

on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useSpeed = true
)

on Init pCont do
(
)

on Proceed pCont do
(
count = pCont.NumParticles()

if pCont.particleTime==400f do
(
global ages = #()
for i in 1 to count do
(
pCont.particleIndex = i
ages[i] = pCont.particleAge
)
)


if pCont.particleTime>400f and pCont.particleTime<1125f do
(
for i in 1 to count do
(
pCont.particleIndex = i
pCont.setParticleAge i ages[i]
)
)
)

on Release pCont do
(
)

Thanks,
Bob

OlegB
07-27-2007, 05:57 PM
For consistency sake, you may need to adjust particle age at post-step phase. Particle modification in post-step phase is not possible with scripting but possible with Box#3.

Thanks,
Oleg B.

bobweb
07-27-2007, 06:21 PM
Thanks for the answer! So you say that what I want to do is not possible unless I buy Box#3? Or can you think of any other way of getting around? What I want to do is having a dust cloud from a car made with facings stuck in slowmotion for a certain amount of time. For the opacity of the cloud I use the particle age map, which is causing the problem.

Thanks,
Bob

OlegB
07-27-2007, 09:02 PM
Basically, the problem is that you need two contradicting age values for a particle. One value is to control particle dynamics (the slow mo) and the other value to control particle age map. The slow mo age is used at "normal" step of integration but at render time you need the "age map" age. With Box#3 it is definitely possible to switch from one age value to another by using the particle modification process at pre-step and post-step phase. As far as I know, scripting does not have such flexibility with particles.

Thanks,
Oleg B.

bobweb
07-28-2007, 10:37 AM
Okay, I see the problem there, thanks for clearing it up. Unfortunately I am not in the position to buy additional stuff. Maybe I find some other solution or way around to get the effect. Perhaps with differently animated opacity maps or so...

Anyway, thanks for your advice,
Bob

bobweb
08-07-2007, 09:42 AM
Just in case anybody runs into a similar problem, here is how I solved it: With a small script I adjusted particle mapping dependent on the scale. The bigger they become, the more transparent they become by using a black to white gradient ramp as a map (see attachment). Since this is just a simple test file, do not await anything too fancy there :)

CGTalk Moderation
08-07-2007, 09:42 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.