PDA

View Full Version : Particle per face, and Lock/Bond


Rorschach
11-17-2010, 05:58 PM
I'm trying to generate a particle for each face of an animated (deforming) editable poly object, which stick to the surface.
I can see no way to make 1 vertex for each face via the 'Position Object' operater, so I thought maybe a Birth Script is the way to go, and then use Lock/Bond to stick to the surface.
I've have some success with this, but it's a bit flakey, epsecially when I try to work on a segment of animation and not the whole thing. Is a birth script the best way to go?

With a birth script how do I make sure I only produce all my particles once at the beginning of my animation?
Does pCont.getTimeStart() refer to the ticks from Emit Start in the Birth Script Dialogue?

Any help appreciated...

PsychoSilence
11-17-2010, 07:07 PM
Do you have the Particle Flow Toolbox#3 by any chance?

As they say: "There's an App for that" :)

Rorschach
11-17-2010, 07:37 PM
Vanilla pflow only I'm afraid...

Rorschach
11-17-2010, 08:20 PM
So here's my birth script:


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

on Init pCont do
(

)

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

if (t1 < 0) then (t1 = 0)

if (t2 ==0*160) do --if at frame zero...
(
for i =1 to (polyop.getnumfaces $cylinder01) do
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleTime = 0
pCont.particleAge = 0
pCont.particlePosition = (polyop.getfacecenter $cylinder01 i)

)
)
)

on Release pCont do
(

)

This works fine as long as I'm working from frame zero. I'm having difficulty working out the relationship of the Emit Start spinner in Birth Script and the pCont.getTimeStart() variable. If I try and calculate just certain frames, say 200-300, then do I need to set the Emit Start to 200? I don't want to have to calculate from 0 everytime.

My experiments seem to end up with the Lock/Bond operator offsetting the particles if I try and compute from anything other than frame 0.

JohnnyRandom
11-18-2010, 03:28 AM
You do not necessarily need to call particleTime if you do you should either set it to currentTime or your desired birth frame.


on Proceed pCont do
(

t1 = pCont.getTimeStart() as float

if (t1 == 200*ticksPerFrame) do
(
for i in 1 to (polyop.getnumfaces $Cylinder01) do
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
--pCont.particleTime = currentTime
pCont.particleAge = 0
pCont.particlePosition = (polyop.getfacecenter $Cylinder01 i)

)
)

)

CGTalk Moderation
11-18-2010, 03:28 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.