The name AnimMontage came from our cinematics director, Greg Mitchell, when we asked for his help naming an asset that can contain animations that you can stitch or edit with sections you can jump between. Montage is defined as “the technique of selecting, editing, and piecing together separate sections of film to form a continuous whole”, and I think this still works very well for what this asset does.
So what is AnimMontage and why do we need it?
AnimMontage is an asset that you can plug into AnimGraph in run-time and you can modify any state of it. For example, you can jump to different sections or you can re-link different sections. This is mostly for code driven animations or one-off animations such as melee attacks, allowing you to control triggers, stop when you want, or change state (looping or non-looping) between.
Our focus for UE4 AnimGraph has been to decouple in-game data and animation data. We’d like to make animation data independent from in-game data – i.e. AnimGraph doesn’t have any idea about Pawn. This will guarantee that we can preview everything in-editor if the state of AnimGraph is same. This worked great, but now we had this opposite problem where when code has to control, how do you do that without directly invading AnimGraph? We didn’t want Pawn to modify the AnimGraph node state. That would totally break the plan we had all along. That’s where AnimMontage comes in. This is the asset that the content creator creates, stitching/editing animations and managing sections, and then the coder asks AnimGraph to play this asset.
Here is a picture explaining the relationship between AnimGraph and Montage.
The requestor (coder or blueprinter) asks AnimGraph to play this montage. AnimGraph will plug each track into the slot node that name matches. It will play as set up in the content until the requester changes the state.
What kinds of things can you change? We originally thought of changing position directly, but that can mess up easily as animations can often change a lot during production. So we added sections. This section will be vertical timeline markers and you can jump between sections, re-link, or make it loop.
The easiest example I have is a melee attack with 3 sections [start, loop, and end]. When the player left-clicks, it triggers the start section by default when you ask to play that montage. Now the middle section is set to loop. When the start is done, it will transition to loop, and it will loop there forever. If the player lets the mouse button go, it will stop, but you don’t want to stop right away since the animation will pop in the middle of loop. You’d like to relink loop to the end, where it will then transition out to the end and finish the animation.
That is a basic scenario of montage usage. The idea is for coders or blueprinters to control its flow via sections.
That is it for now! I hope this helps you better understand AnimMontage. If you have any questions, drop by our forums and ask. We’re happy to help!