PDA

View Full Version : fluid's cache disapears! huh?


Phredrek
09-25-2006, 09:07 PM
Hey everyone!

whenever we go to cache our fluids, we seem to loose alot of them. right when we save it, maya will just seem to delete it all. just like that 8hours worth of caching just isn't recognized.

has anyone else run into this problem?
is it a bug in maya?

we're using maya 6.5 complete, on pretty powerful machines. we cache to a network drive. maya says our cache files are anywhere between 1.7gigs to 78gigs but in reality it's just a fraction of that.

your help is greatly apreciated. we have alot of fluid shots that need to be working.

thanks!

_stev_
09-25-2006, 09:37 PM
Maya Complete doesn't come with Fluids. Maybe the license won't allow you to save the caches.

Stev

essencedesign
09-25-2006, 09:55 PM
If your caches come in at over 2 gigs many times Maya won't be able to load them back again. Seems to be stable on most machines I've found to about 2.6 gig (in the estimate) anything over that seems to crap out, but it seems to depend on the machine, and if you are planning on a network render I'd stay lower than that for sure.

Phredrek
09-25-2006, 10:22 PM
oooo.. that's going to be really difficult to keep cache files under 2gigs.

There are some files that do work and then some files that don't. I totally don't understand why some of our cache files won't save out or keep

essencedesign
09-25-2006, 10:59 PM
You can try to cache one file per frame but I've found that to not be very reliable either. Why are your cache files so large you can do a lot with the 2 gig limit, if you are running a very long sim consider breaking it up in to a few separate scenes, when you get to the end of your first scene/cache save your scene, and then set initial state, delete cache and continue on with your next scene, ect ect, you may end up with quite a few scenes but each will be an accurate continuation of the previous and you can string the renders together in comp. :)

apoc519
09-26-2006, 12:28 AM
make sure you only cache the elements you need. Like density and temperature. That can bring down your cache size a lot

Phredrek
09-26-2006, 03:04 PM
thanks for those suggestions! I will definately try them out.

The reason our cache files are so huge is because of the scenes we are working with. for example, our biggest scene is a fluid creating a bunch of dust kicking out from behind it while it skids around a corner (like a rally car), the distance and how close up we are, we need a much higher resolution plus the footage goes from fast to slow motion to fast. The fluid box needs to be big and plus the whole scene is camera tracked from boujou therefore we can't slow down the car to and speed it up in post so we could use a lower sampling rate.

Phredrek
09-27-2006, 08:22 PM
hey guys!

I just want to say that we solved our problem
we are using doFluidsDiskCache

which splits up the cache files into segments of however many frames you want and you still have a great deal of control over the caching type. just had to do it through mel which wasn't as obvious than some option box somewhere convenient. oh well.

thanks again!

Mikael_CC
09-28-2006, 03:45 PM
hey guys!

I just want to say that we solved our problem
we are using doFluidsDiskCache

which splits up the cache files into segments of however many frames you want and you still have a great deal of control over the caching type. just had to do it through mel which wasn't as obvious than some option box somewhere convenient. oh well.

thanks again!


Do you mean 1 file per frame or segments of say 10 frames per caches? if the later i'd be very interested on how that was acomplished.

Phredrek
09-28-2006, 04:56 PM
the later
you have to do it through a mel script

you can look it up in the help under "caching fluids"
or here is a paste from the maya 6.5 help:


============================================================

Fluid Effects

http://localhost:4448/Maya6.5/en_US/icons/i_icon_16x17.gif Caching fluids

You can speed-up the playback of your fluid effect by creating a fluids cache. A fluids cache file stores the resulting data from a solved fluid simulation. When you playback a cached fluid, Maya no longer has to take the time to solve the fluid simulation. Instead, Maya reads in the data contained in the specified fluids cache file and plays the fluid effect rather than re-calculating the fluid simulation. Caching your fluid effect has the following benefits:


You can play the simulation more quickly and scrub back and forth through the fluid effect's animation using the Time Slider
You can re-use caches so that you do not have to solve at render time
Fluids cache files are disk files with the extension .mcfp that are stored in your project's data directory. By default, when you open a scene file, Maya creates copies of a scene's fluids cache files and places them in your system's temporary file directory.



Note

You can use the diskCache -tmp MEL command to determine the location of your temporary disk cache files.





These temporary files are used to store any changes to your fluids cache that occur between file saves (File > Save Scene) and are required for you to be able to edit your fluids cache.

You can use the Copy Cache File Locally attribute to turn off the creation of these local copies for any fluids playback cache file. This is useful if you are low on disk space or are using a network for distributed rendering. See Copy Cache File Locally (http://localhost:4448/Maya6.5/en_US/Fluids/cachefluidshapenode.html#wp210096) and Control the creation of temporary fluids cache files (http://localhost:4448/Maya6.5/en_US/Fluids/controlthecreationoftemporaryfluidscachefiles.html#wp210283).

When creating your fluids cache, you can choose from the following cache file formats:


Single file fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp211852)
One File per Frame (OFpF) fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp211735)
Segmented fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp210455)


Note


You can not change the Cache File Format once a cache has been created. You must first delete the existing cache and re-create it using the desired format.
Over and Under sampling are only available for caches created in the Single File format.




Single file fluids cache

Single file fluids caches are fluid cache files that contain all the simulation data for a single fluid. Single File is the default fluids cache format.

If the size of your fluid effect is greater than the limit set by your system (for example, 2 GB), then you can create the cache for you fluid using the One File per Frame or Segmented formats. See One File per Frame (OFpF) fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp211735) and Segmented fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp210455).

One File per Frame (OFpF) fluids cache

By default, Maya creates one cache file per fluid. However, some systems impose a limit on the maximum size a file can have. The size of a fluids cache file depends on the resolution of the fluid being cached and the properties (density, velocity, and so on) stored in the cache. Large fluid caches can sometimes exceed a system's file size limit.

When you have a large fluid, you can decrease its playback time by saving its fluid cache in the One File per Frame (OFpF) format. The OFpF format creates one cache file for each frame specified in Cache Time Range. The One File per Frame option is located in the Create Cache Options window. See Fluid Effects > Create Cache (http://localhost:4448/Maya6.5/en_US/Fluids/fluideffectscreatecache.html#wp210857).

Limitations

Single fluids cache files are first stored in the disk cache temp directory and are only copied over to your project's disk cache data directory when you save your file. Since OFpF fluids cache files are created and stored directly in your project's disk cache data directory, you need to consider the following limitations:


Your scene must first have a name before you can create an OFpF fluids cache. You can name your scene by selecting File > Save As or by using the file -rename MEL command.
Since OFpF caches are written directly into the project data directory, Maya cannot always determine when it's safe (for example, whether or not a disk cache file in the project data directory may be referenced by an unopened scene) to delete the cache file from the disk. Therefore, it is up to you to remove any unneeded cache files from the data directory.
Since OFpF caches always copy the cache file for the current frame to the temporary directory (MEL: diskCache (http://localhost:4448/Maya6.5/en_US/Commands/diskCache.html) -tmp) control over the creation of the temporary file copies is disabled for OFpF caches.


Tip

If a cache node is named cache_fluidShape1, the name of this intermediate file is available via the MEL command:

getAttr cache_fluidShape1.hiddenCacheName.

The location of this file is the diskCache -tmp directory.





Example

For a fluids cache for frames 1 to 5, One File per Frame creates 5 different fluids cache files. Each file is named according to the following naming scheme:

segmentPrefix%N_fluidShapeName__%F.mcfpWhere %N is the uniqueness identifier for segmentPrefix chosen by the system to guarantee unique file names among all diskCache nodes in the file scene and %F is the start frame for data in the cache file.

If the 5 frame cache in this example has been created for scene file joe.mb, the OFpF fluids cache files might be named:

joe.mb1_fluidShape12_1.mcfp (frames 1)joe.mb1_fluidShape12_2.mcfp (frames 2)joe.mb1_fluidShape12_3.mcfp (frames 3)joe.mb1_fluidShape12_4.mcfp (frames 4)joe.mb1_fluidShape12_5.mcfp (frames 5)Segmented fluids cache

In addition to OFpF fluids caching, you can use the MEL command doFluidsDiskCache to segment your fluids cache. A segmented cache is a fluids cache that is broken-up into multiple segments or chunks, where each segment contains a specified number of frames. Segmented caches can be used to split a large cache into smaller, more manageable files.

Since One File per Frame (OFpF) caches are a special type of a segmented cache (with a segment size of one), any limitations listed in the OFpF section also apply to segmented caches. See One File per Frame (OFpF) fluids cache (http://localhost:4448/Maya6.5/en_US/Fluids/cachingfluids.html#wp211735).

When you create any segmented cache for a fluid, the dynamic attribute Segment Start Frame is added to the diskCache node. This attribute connects to an expression node called %N_currentSegment (where %N is the segment naming prefix) which uses an animation curve to determine the appropriate segmentStartFrame value for the disk cache at the current time.

Note

Segment Start Frame cannot be modified directly in the Attribute Editor.





Maya uses the segmentStartFrame value to generate the name of the segment file containing the cache data for the fluid at the current time. This cache file is then copied from the project's data directory to the diskCache -tmp directory as needed.

The MEL procedure doFluidsDiskCache takes two arguments:

doFluidsDiskCache (int $version, string $args[])where $version is 2 for Maya 6.5 and $args is a string array. The string array's values are mapped as follows:

string $cacheType = $args[0];int $rangeMode = $args[1];int $sampling = $args[2];float $diskCacheStartTime = $args[3];float $diskCacheEndTime = $args[4];int $samplingRate = $args[5];int $cacheDensity = $args[6];int $cacheVelocity = $args[7];int $cacheTemperature = $args[8];int $cacheFuel = $args[9];int $cacheColor = $args[10];int $cacheDensity = $args[11];int $doSegment = $args[12];string $namingPrefix = $args[13];int $segmentSize = $args[14];The last three elements of the $args array relate to segmented cache files:


$doSegment must be 1 to create segmented of OFpF caches
$namingPrefix is a user-specified string to identify the cache files and expression nodes created in this operation
$segmentSize is used to specify how many frames are stored in each cache file segment.
Example

The following command creates a segmented fluid cache from frame 1 to frame 100, with a segment size of 30:

doFluidsDiskCache 2 { "mcfp", 3, 1, 1, 100, 1, 1, 1, 1, 1, 1, 1, 1, "joe.mb", 30 };Since segmented fluids cache names depend on the name of the fluidShape being cached, the files created in your disk cache data directory might be named as follows:

joe.mb1_fluidShape12_1.mcfp joe.mb1_fluidShape12_31.mcfp joe.mb1_fluidShape12_61.mcfp joe.mb1_fluidShape12_91.mcfp At frame 10, the segmentStartFrame attribute of the diskCache node has a value of 1 because the first cache segment contains the cache information for frame 10, and segmentStartFrame has a value of 61 at frame 75 because the third cache segment contains cache information for frames 61 to 90. Note that the last file created only contains cache information for frames 91 to 100.

==============================

Mikael_CC
09-29-2006, 08:39 AM
I just never realized you could do segmented caches, i've always just stuck to the create fluid cache option box.
Thanks for opening my eyes :)

Phredrek
09-29-2006, 01:22 PM
oh hey no problem!

I just found out myself! I'm pretty new to fluids and it is driving me nuts. so much wait time to cache... wow

good luck with segmenting!

CGTalk Moderation
09-29-2006, 01:22 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.