Resume - Portfolio - Contact - Other Stuff

Part II
Lots of Emitters, Final Size Box

download the scene file here

 
 

STEP 1) Initial Setup

a) First you need to figure out how big, and how detailed, the final product is going to be. Import a reference of some type to base it on. I'll be using a low-poly model of a fireplace (I have a high-poly version ready for later).
b) Translate the box to the appropriate spot, do not scale it.
c) Open the fluidAttrEd and use the size attributes to fit it into the model, making sure it goes a little beyond the edges of the space it needs to fill.
d) Now, you need to adjust the resolution. You should always use the same multiple for all three axis. Based on my model, my size is 5x3x3, and I'll be using a factor of 10, so my resolution will be 50x30x30. If you have an older computer, you'll want to work at a lower resolution for now, and then bump it up before caching. I prefer working at full res, but then I'm not making a fire for an actual movie or anything so my full res is pretty low. Just don't create a cache at low res, thinking you can increase it before rendering. Changing the size or resolution completely invalidates the cache.

NOTE: beware resolution. It is the single largest factor (near as I can tell) in determining how much work the computer does to run the sim. The higher you go, the more detail you can achieve, and the better it'll look; but this is how I got those 45 minute/frame render times I mentioned earlier. If unsure, start low and raise it later.

e) We need to raise the velocity Swirl, because with all the emitters we're gonna add, it'll create a serious updraft and we don't want this to get too boring. Under Contents Details>Velocity knock the Swirl up to about 20.

e)you seem to be without an emitter, so drag it back into the box. It should be pretty small, so adjust the size if needed.

STEP 2) More Emitters

NOTE: this is kind of a pain, but I don't know a better way to do it, so here goes.
a) Create another torus, scale it down and translate it into the box. It should be about the same size as the first.
b) now duplicate this one several times(I'll be using about 30 of 'em) and drag them around randomly, but within the box.

NOTE: beware the beating this is about to give your computer. each of these innocent looking little doughnuts is going to be an emitter, and this is the second largest factor in calculation/caching/render times.

c) scale them up/down a little just to add variance, don't make any very large or very small; only like a 5-10% difference



d) select all of the tori, then the fluid, and Fluid Effects>Add/Edit Contents>Emit From Object.
e) right now, all of these emitters have the same attributes which would make an unusually boring fire. We need to randomize a few of these attributes, which is the pain in the ass I mentioned earlier, 'cuz there's no way to see all these attributes at once. You have to open the fluidAttrEd and go through one emitter tab at a time.

for the first emitter we used heat 2, and fuel 4. Now we'll need to use something more like heat 1.1-1.9, fuel 2.5-3.9. The reason we are lowering the heat and fuel is because they are additive. So when we combine the heat from 30 emitters, we don't want it quite so high as when we only had 1. The actual numbers you use don't matter too much(within the ranges), just make sure to balance any extreme highs with an appropriately extreme low. Also, if you use lower fuel emission, you can adjust the Fuel Scale under Contents Details>Fuel in the fluidAttrEd to correct for it.


STEP 3) Caching

a) now being a good time to see what's going on, we'll talk about caches a bit. A cache is a file containing the majority of the solutions to all the millions of math problems a fluid simulation involves. Saving all these solutions into a file, of course, saves a lot of time during playback, all the computer has to do is read the file and draw whatever belongs on the screen. However, saving all those numbers can take quite a while, and the file can get freakin' huge(I've heard there's a 2 gig limit, but I think within a single session you can go as large as you like - the cache just won't work when you reopen maya). When you initially create a cache it is saved in your C:\Documents and Settings\USERNAME\Local Settings\Temp folder under a randomly named folder. When you hit File>Save(as) it saves it to the data folder in your project directory with the file name and fluidshape's name as the root of the file name. If you will be working with a lot of fluids projects at once, I'd recommend being very specific with your fluidshape names.
b) caches allow you to treat the simulation like a normal animation(to limited extent), much like baking a particle simulation. Once a cache has been created you can scrub the timeline or skip straight to whatever frame you want. There is a catch though. If you change anything outside of the Shading section of the fluidAttrEd, it'll ruin the cache. Any thing in the Dynamic Simulation, Contents Details(except temp and fuel Scale), or the emitter tabs will invalidate the cache. One thing - Maya doesn't check to see if you've done any of this. Maya only realizes the cache is useless if you do something like change the size or resolution of the fluid. In any situation where maya doesn't notice the changes, it'll just play the cache and ignore any changes. You'll have to delete it(Fluid Effects>Delete Cache) and create a new one.
c)now, to actually create a cache. Select the fluid, Fluid Effects>Create Cache Options
d)I tend to use the time slider rather than manually defining a start/end - but that is arbitrary, so do as you please
e)always leave Sampling at over, and unless you are having problems, leave Rate at 1
f)I turn off Color and Texture Coordinates, since we aren't using either and it saves the tiniest little bit of time (I think)
g)click create, go get some coffee or something to eat. Come back later and save the file.

STEP 4)Using the Cache

a)try scrubing through the timeline, not so quick as your used to, huh? but better than it was having to play all the way through the file.
b)individual frame renders aren't gonna speed up any from this, but batch renders are way faster now - so do a test render.

EXTRA - MEL commands

I hate waiting, and the only thing worse is waiting, clicking one button, waiting, clicking one button, waiting, clicking one button, etc, etc. I use the following commands (in a shelf button) to do the past few steps all at one go.
doFluidsDiskCache 1 { "mcfp", 2, 1, 1, 200, 1, 1, 1, 1, 1, 0, 0 } ;
file -save;
BatchRender;

The only problem with this is that sometimes maya gives an error message when loading the cache (to start the render) because it thinks there are two with the same name. This message sits and waits for you to close it (don't hit OK, it'll just come back - close it with the X) which ruins the nice part of the script. I can't figure this out at all, so if you do - let me know.

 

Examples

Intro - Part I - Part II - Part III - Part IV