stwert
19-03-2014, 05:21 PM
I'm trying to constrain a locator to a particle, but no matter what I attempt, the locator is always trailing the particle by one frame.
I have tried to use a normal expression of the type:
vector $position = `nParticle -at worldPosition -id 0 -q targetParticleShape`;
loc.translateX = $position.x;
loc.translateY = $position.y;
loc.translateZ = $position.z;
And I have tried putting the evaluation after dynamics by doing something like this in the particle expression Runtime after dynamics:
vector $partPos = targetParticleShape.position;
float $xPos = $partPos.x;
float $yPos = $partPos.y;
float $zPos = $partPos.z;
loc.translateX = $xPos;
loc.translateY = $yPos;
loc.translateZ = $zPos;
But they all come to the same thing... the locator is delayed by a frame and is not fully constrained to the particle position.
Basically if I pause the sim and evaluate the particle position query it comes out as a different value as the current translate of the locator. It must be possible to make these equal.
Any thoughts?
I have tried to use a normal expression of the type:
vector $position = `nParticle -at worldPosition -id 0 -q targetParticleShape`;
loc.translateX = $position.x;
loc.translateY = $position.y;
loc.translateZ = $position.z;
And I have tried putting the evaluation after dynamics by doing something like this in the particle expression Runtime after dynamics:
vector $partPos = targetParticleShape.position;
float $xPos = $partPos.x;
float $yPos = $partPos.y;
float $zPos = $partPos.z;
loc.translateX = $xPos;
loc.translateY = $yPos;
loc.translateZ = $zPos;
But they all come to the same thing... the locator is delayed by a frame and is not fully constrained to the particle position.
Basically if I pause the sim and evaluate the particle position query it comes out as a different value as the current translate of the locator. It must be possible to make these equal.
Any thoughts?