SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Maya Questions / Dynamics & Special Effects / Delayed particle tracking

Dynamics & Special Effects Maya Particles, nDynamics, Fluids, Rigid Bodies & General VFX

Join the conversation. Reply to post
 
Thread Tools
19-03-2014, 05:21 PM   #1
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Delayed particle tracking
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:
Code:
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:
Code:
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?
  Reply with quote
19-03-2014, 05:50 PM   #2
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Not off the top of my head, and I don't have an installation at the moment to test something out, however you could try using a particle to curve path script, then attaching the locator to it via a motion path. It should work as long as your particle has constant velocity.
__________________
Imagination is more important than knowledge.
  Reply with quote
19-03-2014, 05:53 PM   #3
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Thanks ND, that might work. Unfortunately the locator actually will end up influencing the sim itself, so it kind of needs to happen on the fly, otherwise I would cache the sim and do a similar hack to get it in the right place at the right time.
  Reply with quote
20-03-2014, 06:46 PM   #4
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
So the resolution of this ended up being that I just ignored the delay for the simulation and decided not to have the locator's downstream effects influence the simulation. Then when I cached the simulation, the locator "caught up" and there's no longer a delay. It's kind of strange, but I assume that using the cached simulation allows Maya to put the proper information at the proper time because it knows what will happen on a given frame?
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
particle direction with animated characters Razor Blade Dynamics & Special Effects 0 19-05-2012 01:01 AM
Particle Painting on Live Surface LadySekhmet Maya Basics & Newbie Lounge 1 27-07-2011 04:28 AM
creating a particle grid on plane or otherway round. bendingiscool Programming 3 19-05-2008 11:33 PM
how to emit only one particle? fxfreak1 Dynamics & Special Effects 1 22-06-2006 07:45 PM
Texture or material on particles? dax3d Dynamics & Special Effects 6 24-04-2003 12:07 AM