Notifications
Clear all

[Closed] PFlow – script in Render event deletes user data channels??

Ok, I’ve built a Flow like this. One particle, after 10 frames it goes to event 02 gets assigned its own particleID into the particleInteger channel, gets spawned and dies.

Two new particles go to event 03 , die after 10 frames and through script print out their particleInteger channel. You get print out like this:
1
1
1
1
1
1

So far great – we’ve spawned particles with their parent’s ID in the integer channel.

Now the problem:
as soon as you insert any script in the render group at the top – so you make a global script, that has pCont.useInteger = true in it, the particleInteger data channel gets zeroed out!
You get a printout like this:
1
1
0
0
0
0

For some reason the global script can’t read the particleInteger channel data. This happens ONLY when the channel data comes from a previous event.
As soon as you disable the global script everything is back to normal.

Script01:


on ChannelsUsed pCont do 
( 
pCont.useInteger = true
) 
 
on Proceed pCont do 
( 
pnum=pCont.NumParticles()
for i in 1 to pnum do 
( 
	 pCont.particleIndex = i 
	 pCont.particleInteger = pCont.particleID 
) 
)

Script 02


on ChannelsUsed pCont do 
( 
pCont.useInteger = true
) 
 
on Proceed pCont do 
( 
pnum=pCont.NumParticles()
for i in 1 to pnum do 
( 
	 pCont.particleIndex = i 
	 print pCont.particleInteger
) 
)

Script 04 – global script


on ChannelsUsed pCont do 
( 
pCont.useInteger=true
) 
 
on Proceed pCont do 
( 
)

I’m trying to output data channels to a global array to use with an external script, but this way not only does it work only for data assigned within the boundaries of an event, but also if the flow uses the data further on, trying to read the data globally screws up the flow!