Monday, January 28, 2013

Personal tutorial: Gathering Particles in a Container

So this tutorial (less of a tutorial, more of an answer) I did was to cause sand to flow out of an hourglass and stack.  While it seems rather simple, some things must be taken into account.

A. The type of particles used.  Particles, not nParticles, do not have the force of gravity applied to them.  So one must select them and apply a gravity field.  Also, with regular particles, one simply needs to select them and the object to collide with, and select 'Make Collide' under Particles.  With nParticles, however, the object must become a passive collider, which is an option under nMesh.  Then the nParticles automatically collide with the collider.    (Warning:  As far as I can tell, an object cannot be a passive collider and a passive body, so if what you're doing requires such properties, then you'll have to find a workaround.)

B. Filling a container, even by scaling the particles up, will be quite tedious and require upwards of 15,000 frames (I hope is an overestimate), which, at 24 frames per second, will last about 10 1/2 minutes, possibly longer, depending on how many particles are emitted, their lifespan, and how much Maya loves you.  (Given my estimate, you can tell Maya hates me, as I did 2,000 frames at 200 particles per second, and almost NOTHING happened from frame 100 on.  Or maybe that's what it takes.  *sigh*)

At any rate, the particles add up fast, so you'll need some computer power for this.  So here's the playblast, and I did some rotations to prove that it works fails.  If the video can load, that is...




Edit: For some reason, the regular particles fly right out of the container when it's rotated.  Don't know why.  Something to find out.  I suspect it's that the hourglass is not entirely seamless.  I'll keep the fail playblast up to show at least the general principle, and what can go wrong.  If you want more information, read this.

So this should work with nParticles, right?  Yes!  Now to investigate the reason...
Right is particles, left is nParticles.