I have used the nsUninstancer plugin and it worked great, but unfortunately it is for an older version of Maya. I basically am going to try to recreate it in mel (even though it will be much slower).
The issue I am having is this:
If you have a random object index (objIndexPP) assigned to the particles, and the particles have a short lifespan, depending on how you set them up particle.pt could be emitted, then die, then be emitted again. This could lead to mesh1 being instanced to particle 0, then perhaps mesh2 instanced to particle 0 when it is birthed again. This is proving to be somewhat tricky when you are trying to bake the particles out to meshes.
Granted, it could be setup in the particle to avoid this situation, but I want to make the script as robust as possible and try to have it be smart enough to overcome this issue.
So my question is:
How would you guys go about tracking when the particle dies (when lifespan is set to constant, not lifespanPP), and your approach to baking this out.
My idea is to run through the sim, and store each vector position in a string array, where each index corresponds to each particle id. So every 3 values represent the xyz postion of the particle. I am also thinking of having another string array for each particle object at every frame and querying what mesh is assigned to that particle and storing the value.
I am having a tough time trying to determine when a particle has died and it has been birthed again. I suppose checking if the age is < the previous frame could work, just wondering if you guys had a more elegant solution.