+1 tag for Google+

Wednesday, 14 December 2011

Maya Particles Initial State - Method 2

I came home to do a more exhaustive search for the case of the un-reset-able initial state of Maya particles.
I came across a message thread from area.autodesk.com hosted by AutodeskIt says when the initial state is set, there will be a folder created in the current project called "initial state". Once this folder is removed, particles will lose their initial state information on the first frame of the previously set frame-range. 

A user even contributed 2 lines of MEL commands. Select the particle object and run the following:
setAttr ".position0" -type "vectorArray" 0;
setAttr ".lifespanPP0" -type "doubleArray" 0;

This zeroes out the particle's per-particle attribute called position0  (this is the per-particle's initial state's position in local space), and set the lifespan to zero. 

I tried setting my project workspace, created a particle object and set my initial state for the particles. True enough there was directory created, with a single file which is the cached start frame information of the particles. 
(ie, /particles/<filename>_startup/<particleName>.pdc). 

I went to delete the .pdc file, nothing happened. Particles still went back to the previously set initial positions at start of the sequence. It is the same after I proceed to delete the ./particles/<filename>_startup/ folder. 

Next I ran the 2 lines of MEL commands:
setAttr ".position0" -type "vectorArray" 0;
setAttr ".lifespanPP0" -type "doubleArray" 0;

I have tested this out a few times. Usually, at this point the scene would become unstable and the simulation inaccurate. Therefore I advise you to save, and re-open the scene file. 

At first glance it looks like the problem is solved. All the particles' positions are set back to zero (in the particle object's local space). However, if you turn the particle display type to "numerical" (that means each particle's particleID is displayed), you will see that every particle that was ever involved in the creation of the previous "initial state" did not die, or disappear. They are all there at the local <0, 0, 0>

So for example if my particle's previous initial state involved 1000 particles, and I re-set the initial state following the above steps, I will get 10000 particles positioned at <0, 0, 0>. So if now I start running my simulation again, and my emitter is set to 10 particles per second, on the first frame I will get 1001 particles all beginning to sim from the same point at <0, 0, 0>! This would definitely be a different visual result I would see if I were to create a new emitter with a new particle object.

To test this, all you need to do is to rewind the sim back to the start frame, and play it back. For the above example of 1000-particle initial state, when I playback, I should see 1000 particles moving away from the emitter's position (or the local <0, 0, 0>, if they are not in the same world space), then followed by a constant stream emitting 10 particles per second.

No comments:

Post a Comment