how to randomize particle position after custom particle birth script from orbaz ?

here's the script from orbaz's site.

on ChannelsUsed pCont do
(
pCont.usePosition = true
)

on Init pCont do
(
global obj=$Shape11 --object with selected verts
)

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

if (t1<0 and classOf obj==Editable_Poly or classOf obj==Editable_Mesh) then (

for i in obj.selectedVerts do
(
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles() -- last particle that was added
pCont.particlePosition = i.pos
)
)
)

on Release pCont do
(
)

The problem is that the particle placement creates repetitive patterns when scattering few group objects in one shape instance node.

How can i randomize particles (change their position seed) after setting their birth in birth script?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mark pigott's picture

Add this after

Add this after pCont.particlePosition=i.pos

CurPos=pCont.particlePosition
CurPos+=pCont.randSpherePoint()*50 ---this will give 50 random units, xyz
pCont.particlePosition=Curpos

It should work, if not get back to me

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.