Terrain Animation, possible?
#1
Hi,



Testing the terrain, I love it. Is it possible to animate the parameters? Or is it something planed in the future?



I add keys to colors, warp, noise, phases etc... but it doesn't animate, eventhough they are visible in the curve editor.

It only changes when scrolling the values with the mouse.



I've also tried animating with callbacks, but so far no luck:

Code:
fn updateTF = (
    at time currenttime (
        for t in getClassinstances Tyflow do (
            print ("Changing noise phase for " + t as string)
            print ("frame " + currentTime as string)
            t.Peak.Terrain_Warp.noisePhase = currenttime.frame * 0.1 / 2
            t.Peak.Terrain_Color.layerMaskNoiseFXFlowRoughness = currenttime.frame * 0.01
        )
    )
)
callbacks.removeScripts id:#TY1
callbacks.addScript #beginRenderingActualFrame "updateTF()" id:#TY1


It doesn't work with #postRenderFrame callback either


 

[edit]
sorry, my bad, it's possible to animate with Callbacks. The issue was that I had 2 terrain groups with the same name.
Renaming to Peak1 and Peak2 works:

Code:
fn updateTF = (
    at time currenttime (
        for t in getClassinstances Tyflow do (
            print ("Changing noise phase for " + t as string)
            print ("frame " + currentTime as string)
            t.Peak1.Terrain_Warp.noisePhase = currenttime.frame * 0.1 / 2
            t.Peak2.Terrain_Warp.noisePhase = currenttime.frame * 0.1 / 2
            t.Peak1.Terrain_Color.layerMaskNoiseFXFlowRoughness = currenttime.frame * 0.01
        )
    )
)
callbacks.removeScripts id:#TY1
callbacks.addScript #preRenderEval "updateTF()" id:#TY1

Also set the callback in #preRenderEval mode
  Reply
#2
No need to use callbacks...just set the operator timings to Continuous.

Note that once you start animating the terrain operators, you need to be mindful of how all their blending modes interact. So for example, if you initialize your terrain and then add a Terrain Noise operator (whose blending mode default is 'Add')...by setting its timing to Continuous, it will additive apply changes to the terrain over time....whereas, if you change the blending mode to "Set", the changes will no longer add on top of each other.

If you are animating parameters that don't need to be history dependent (ex: you're not trying to make cumulative changes over time to the terrain, like in a liquid sim)...you can also experiment with setting the flow's simulation mode to "history-independent". This is a new experimental setting that was added specifically for this purpose - so you don't need to simulate unnecessary frames for non-cumulative terrain animations.
  Reply
#3
Here's an example file showing how this is done.

I haven't set any keys here....I've just changed the Terrain Noise frequency value, which will cause it to evolve over time.

I've also changed the flow's simulation mode to "history-independent". Notice how you can click on any frame in the timeline and it doesn't need to simulate prior frames to get there - it only ever simulates a single frame. This is the power of the new simulation mode. Change it to "history-dependent" and now the simulation must iterate through all prior frames to reach a given frame - despite the result being identical.


Attached Files
.max   terrainAnimation.max (Size: 632 KB / Downloads: 190)
  Reply
#4
Thank you for the detailed explanation. It totally makes sense, and I don't know how I didn't think about changing the timing!

Thanks again
  Reply


Forum Jump: