Oct 2002
1 / 3
Oct 2002
Oct 2020

Hi! Is there any tools or methods to constraint an object to a particle?

Thanks!

  • created

    Oct '02
  • last reply

    Oct '20
  • 2

    replies

  • 4.5k

    views

  • 3

    users

This is an example expression to get you started :

Make your object and rename it object1. Turn on vertex snap and create a particle where your object is. Then apply this expression

// Get position of particle 1 in particleShape1
$particlePos = getParticleAttr -array true -attribute worldPosition
"particleShape1.pt[0:1]"
;
// Fix object to particle
setAttr "object1.translateX" $particlePos[0];
setAttr "object1.translateY" $particlePos[1];
setAttr "object1.translateZ" $particlePos[2];

Now apply a dynamic field to the particle (make sure its linked in the relationship editor) and play it back. The object should be fixed to the particle.

18 years later