kachoudas
02-14-2005, 08:41 PM
Hello guys,
Here is what I want to do : I want to have the particles of a Pflow system be created by a script that
1/ place each of them at the place of a pre-existing object
2/ give the exact shape, material of the object
3/ eventually hide the original object.
Here is the script I have made so far : (event with just birth script, speed and display operators)
-- On birth script
on ChannelsUsed pCont do
( pCont.useTime = true
pCont.useAge = true
pCont.usePosition = true
pCont.useShape = true
)
on Init pCont do (global My_box = $Box*) -- where Box01 to Box12 are the preexisting objects (turned to editable meshes)
on Proceed pCont do
(
ti = currentTime
if (ti == 5) do (
for i = 1 to 12 do (
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleTime = ti/192 -- ???? not sure why this is for... I left it from the original script I copied... just changed to 25(192) fps
pCont.particleAge = 0
pCont.particlePosition = My_box.transform.pos [i]-- I should also copy the rotation and scale
pCont.particleShape = My_box[i].mesh
)
)
)
on Release pCont do ()
It worked fine for the placement part (the particles shows as ticks), but not for the geometry - they don't show at all. So I tried to put the shape part in a script operator
-- On a script operator
on ChannelsUsed pCont do ( pCont.useShape = true )
on Init pCont do (global My_box = $Box*)
on Proceed pCont do (
for i = 1 to 12 do (
pCont.particleIndex = i
pCont.particleShape = My_box[i].mesh
)
)
on Release pCont do ()
But it was the same thing (no geometry appearing at all)
I wrote this by copying exemples in the documentation. But I am very aware that I still don't fully undertand the "Proceed Pcont" process. Also I'm not sure of the mesh part ... so that is why any tips are welcome !
Thank you in advance !
Jerome
PS : also, if any one has some pointer to give to me as how to have each of these particles start "around" frame 5 (+/- n frames for each particle)
Here is what I want to do : I want to have the particles of a Pflow system be created by a script that
1/ place each of them at the place of a pre-existing object
2/ give the exact shape, material of the object
3/ eventually hide the original object.
Here is the script I have made so far : (event with just birth script, speed and display operators)
-- On birth script
on ChannelsUsed pCont do
( pCont.useTime = true
pCont.useAge = true
pCont.usePosition = true
pCont.useShape = true
)
on Init pCont do (global My_box = $Box*) -- where Box01 to Box12 are the preexisting objects (turned to editable meshes)
on Proceed pCont do
(
ti = currentTime
if (ti == 5) do (
for i = 1 to 12 do (
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleTime = ti/192 -- ???? not sure why this is for... I left it from the original script I copied... just changed to 25(192) fps
pCont.particleAge = 0
pCont.particlePosition = My_box.transform.pos [i]-- I should also copy the rotation and scale
pCont.particleShape = My_box[i].mesh
)
)
)
on Release pCont do ()
It worked fine for the placement part (the particles shows as ticks), but not for the geometry - they don't show at all. So I tried to put the shape part in a script operator
-- On a script operator
on ChannelsUsed pCont do ( pCont.useShape = true )
on Init pCont do (global My_box = $Box*)
on Proceed pCont do (
for i = 1 to 12 do (
pCont.particleIndex = i
pCont.particleShape = My_box[i].mesh
)
)
on Release pCont do ()
But it was the same thing (no geometry appearing at all)
I wrote this by copying exemples in the documentation. But I am very aware that I still don't fully undertand the "Proceed Pcont" process. Also I'm not sure of the mesh part ... so that is why any tips are welcome !
Thank you in advance !
Jerome
PS : also, if any one has some pointer to give to me as how to have each of these particles start "around" frame 5 (+/- n frames for each particle)
