Pflow Birth Script + Standard Birth Problem...


#1

Hi All,

I’m relatively new to pflow, and currently working on a project which involves shattering a mirror.

I’m using Alan McKay’s birth script which converts geometry into pflow particles, referencing their position and shape. This has worked really well for the main shatter, but I’m running into problems when I try to add a secondary flow for some “little bits” eminating from the main shards.

The second I add a standard birth operator to the second flow, the birth script from the first flow fails, and informs me there is an error. Is there a way to have the birth script and the standard birth operator co-exist happily?

Thanks in advance.

Here’s the script:

on ChannelsUsed pCont do
(

  pCont.usePosition = true
  pCont.useShape = true

)

on Init pCont do
(
global groundGeom = $Shape* 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 groundGeom.count
     for i in 1 to groundGeom.count do
         (
             pCont.particleIndex = i
             pCont.particleShape = groundGeom[i].mesh
             pCont.particlePosition = groundGeom[i].position
     )
 )

)

on Release pCont do
(

)

And the failing flow:


#2

May or may not work but try using the same render event for both flows.

You could also bake the animation of the first flow then add the second debris flow to that instead.


#3

I added the first (large shard) particles to cache with manual update, and was able to then add the “particulate bits”.

Thanks so much for the solution, and the quick reply.

Cheers!


#4

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.