From the course: 3ds Max: Tips, Tricks and Techniques

Transform and retime a cache with Fluid Loader - 3ds Max Tutorial

From the course: 3ds Max: Tips, Tricks and Techniques

Transform and retime a cache with Fluid Loader

- [Narrator] The fluid loader object gives us the ability to manipulate a fluid cache already stored on disk. With the loader we can transform a fluid cache in both space and time. This is something we could not do previously. Without the fluid loader we could not even move a liquid object. But with the loader we can not only move, rotate, and scale, but we can change the playback speed, play the cache backward, reuse the same cache files multiple times in the same timeline, and generally warp time any way we like. So let's do that, we'll open up the simulation view. Go in to animation, fluids, simulation view. Open up Liquid001 which is the object, select the syrup_solver, and then all of its parameters load. We need to have a cache in order to use the fluid loader so we'll need to run the simulation. Click on the play button and the simulation begins to calculate, give that a few minutes while the simulation processes and the cache is stored on disk. Once the simulation has completed we can just rewind and play back to see that we have some slow-moving fluid here, meant to represent maple syrup. Stop and rewind and let's add the fluid loader. We can create a fluid loader from the create panel and then add the cache, or we can create the fluid loader directly in a simulation view. Creating it from the simulation view saves us from the task of navigating through our project folder to find the right cache files and it will also make sure that the cache starts out properly aligned in the scene. In the solver management area right-click on any solver that has a cache already and then choose create loader from cache. And the add cache dialog appears. This one only has a fluid cache, keep that enabled and click OK. And now we have a fluid loader object in our scene. If we choose FluidLoader001 here in the management area then we can see in the loader properties tab we have frames zero to 46 loaded in. So this has been added for us automatically but if we needed to of course we could add or remove using these buttons here. Now that we have a fluid loader in our scene we can actually manipulate the cache. Select the fluid loader and you can use the transform tools such as move and reposition that, I want to do that with Ctrl Z. Or even more useful is the ability to scale. This will let you scale a cache after it's been saved to disk which can actually be quite helpful when you're working with miniatures or bigatures for that matter. I want to do that with Ctrl Z as well. And we can also manipulate time. This is where things get really interesting. I'll just go back to the select object tool. And here in the cache playback section of the loader properties we have the ability to manipulate time, play it forward, backward, or warp time any way we want. It's defaulted to the original range which is as we see here frames zero to 46. But there are a bunch of other modes here. If we choose custom start then we'll just offset the beginning of that cache. So we'll start in a different frame. So we could say, start the cache on frame 10, and then press play and the cache doesn't start until frame 10 of the timeline. We can also choose a custom range which allows us to stretch time if the range is longer or shorter than the duration of the original cache. And we can see that the default custom range is to start on frame zero and end on frame 100. Let's go in to our time configuration, down here, time configuration, and just set the end time to frame 100, click OK, and play that back and we can see that the cache is playing back instead of from frame zero to 46, but from frame zero to 100. I'll stop that and rewind, and we can even do crazy things like play backwards and say start on frame 100 and end on frame zero. So now it's playing back in slow motion in reverse. Alright, that's very cool, but even better, if we go back to the cache playback pulldown we can choose playback, graph, and this allows us to set key frames on this field to play the cache backward or forward at any speed. So let's do something really interesting here with this, with the timeline on frame zero and the playback graph frame number at frame zero, let's enable auto key and then go down to frame 15, I'll just type that in, and let's set the playback graph frame to 15 as well. And now I should have some key frames here, and indeed we do. So we won't see the key frames in the timeline unless we select the loader object, and once I've done that we can see that we've got key frames on zero and 15, and after frame 15 we don't get any motion in our fluid cache. So let's continue onward, let's go to frame 30. And in the cache playback let's just freeze the motion for a little bit. We'll set the frame number to 15 again, and the way you do that is you just toggle this up or down until you get back to 15. So now we have no change in the frame number between 15 and 30. So it freezes there, alright, now go down to frame 46 and we can make the fluid cache go in reverse. So we'll set the frame to zero. Rewind and play that back. So we've completely mastered time here. We can finish this up by going down to, let's say frame 92, and at frame 92 we'll set the cache playback frame to 46. And we have another key frame there, we can rewind and play that back. So we're able to do kind of stutter edit here. Now the default key frame interpolation is actually Auto tangents but in this case I want a little bit more control, I want to use a linear tangent type. I'll stop the timeline, rewind, open up the mini curve editor here, and then we need to select the track, which is going to be found in FluidLoader001, Object, and the track name is 0. And to see all of that we need to frame it so let's close the simulation view and click to frame the horizontal and value extents. Select all those key frames and just convert them all to linear. And we can turn off auto key and close the mini curve editor and now with the linear interpolation between key frames we have better control over the frame indexing or the relationship between the cache frames and the timeline frames. There won't be any additional ease in or ease out other than what already exists within the cache itself. And that's how to use the fluid loader to manipulate a liquid cache.

Contents