|09 September 2012||#1|
a large dark room . . . . ... . .. ...with bright monitors
Join Date: Mar 2002
Crazy Question for Duncan! nConstraints and Particles
So, is it possible to hook up a particles lifespan to the nconstraint it is attached to?
For example, in your butterExtruderSlice scene, if you randomly kill off particles, is there a way to get the springs attached to it to die too?
|10 October 2012||#3|
Join Date: Jun 2002
There seems to be an order of evaluation problem when the particle system has an output mesh connection that causes an indexing error when particles are deleted (newly emitted particles think they are killed ones and create wrong links) If you hide the particle to poly mesh when caching then the links seem to correctly be maintained between living particles. Thus for the butter extruder example simply hiding the output mesh when caching should allow particle depth to work OK.
When doing max distance constraints between emitting particles the constraints are rebuilt when the particle count changes. It is different if you have a constraint that has specific particle ids. When a particle dies the link will reform to the particle that now has the same index(for example if you killed particle 6 then particle 7 becomes particle 6), however the rest length for the link will be the same, so this new link is likely to cause a sudden jump. If there is no remaining 2 particles with the same ids then there is no link.
You could try and do something like set the index arrays on the constraint's input nComponent node based on particle death, but it might still have problems if the constraint doesn't update its links. Normally this is done at the start frame or when the constraint becomes enabled, although we do some updating when particle count changes, so it might work.
However for explicit links between particles that can die you might be better off using old style springs instead of nConstraints. I noticed that one may see links incorrectly draw when a particle with a spring dies, but it does not seem to affect the simulation.
A disadvantange of the old springs is that they are not as stable as the nucleus ones, and they do not integrate as well with the solve.
|Thread Closed share thread|