I hope someone can help,
I’m trying to use a pflow script to have object chunks return to their position AND rotation.
The position is working fine if I set the pCont.particleVector = ChunksArray[i].pos
But… if the chunks are spinning, they do not return to their original rotations.
Setting the particlevector to ChunchsArray[i].transform causes the script to fail…
pCont.particleIndex = i
vpos = ChunksArray[i].transform
pCont.particleVector = vpos
Does the particlevector allow you to save the rotation aswell as the position of a particle chunk?
If so, how do I assign the rotation to the particlevector?
Here’s my birthscript.
on ChannelsUsed pCont do
(
pCont.useAge = true
pCont.useTM = true
pCont.useVector = true
)
on Init pCont do
(
global ChunksArray = $Teapot* as array
global TM_Reset
-- TM_Reset = undefined
if ChunksArray != undefined do
(
if TM_Reset == undefined do TM_Reset = true
if TM_Reset do
(
Global ChunksArray_TM = for i in ChunksArray collect i.transform
TM_Reset = false
)
)
)
on Proceed pCont do
(
t = pCont.getTimeStart() as float
NumChunks = ChunksArray.count
if t < 0 do
(
for i = 1 to NumChunks do
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleAge = 0
pCont.particleTM = ChunksArray_TM[i]
pCont.particleIndex = i
vpos = ChunksArray[i].pos
pCont.particleVector = vpos
)
)
)
on Release pCont do ()
Thanks for any help!
Cheers
p.
