Cutout animation ================ What is it? ~~~~~~~~~~~ Traditionally, `cutout animation ( https://en.wikipedia.org/wiki/Cutout_animation )` is a type of `stop motion animation ( https://en.wikipedia.org/wiki/Stop_motion )` in which pieces of paper (or other thin material) are cut into special shapes and arranged in two-dimensional representations of characters and objects. Characters' bodies are usually made out of several pieces. The pieces are arranged and photographed once for each frame of the film. The animator moves and rotates the parts in small increments between each shot to create the illusion of movement when the images are played back quickly in sequence. Simulations of cutout animation can now be created using software as seen in `South Park ( https://en.wikipedia.org/wiki/South_Park )` and `Jake and the Never Land Pirates ( https://en.wikipedia.org/wiki/Jake_and_the_Never_Land_Pirates )`. In video games, this technique has also become popular. Examples of this are `Paper Mario ( https://en.wikipedia.org/wiki/Super_Paper_Mario )` or `Rayman Origins ( https://en.wikipedia.org/wiki/Rayman_Origins )` . Cutout animation in Godot ~~~~~~~~~~~~~~~~~~~~~~~~~ Godot provides tools for working with cutout rigs, and is ideal for the workflow: - **The animation system is fully integrated with the engine**: This means animations can control much more than just motion of objects. Textures, sprite sizes, pivots, opacity, color modulation, and more, can all be animated and blended. - **Combine animation styles**: AnimatedSprite allows traditional cel animation to be used alongside cutout animation. In cel animation different animation frames use entirely different drawings rather than the same pieces positioned differently. In an otherwise cutout-based animation, cel animation can be used selectively for complex parts such as hands, feet, changing facial expressions, etc. - **Custom Shaped Elements**: Custom shapes can be created with `Polygon2D` allowing UV animation, deformations, etc. - **Particle Systems**: A cutout animation rig can be combined with particle systems. This can be useful for magic effects, jetpacks, etc. - **Custom Colliders**: Set colliders and influence areas in different parts of the skeletons, great for bosses and fighting games. - **Animation Tree**: Allows complex combinations and blending between several animations, the same way it works in 3D. And much more! Making of GBot ~~~~~~~~~~~~~~ For this tutorial, we will use as demo content the pieces of the `GBot ( https://www.youtube.com/watch?v=S13FrWuBMx4&list=UUckpus81gNin1aV8WSffRKw )` character, created by Andreas Esau. ![](img/tuto_cutout_walk.gif) Get your assets: :download:`gbot_resources.zip Make IK Chain. ![](img/tuto_cutout18.png) As a result, the base of the chain will turn *Yellow*. ![](img/tuto_cutout19.png) Once the IK chain is set-up grab any child or grand-child of the base of the chain (e.g. a foot) and move it. You'll see the rest of the chain adjust as you adjust its position. ![](img/tutovec_torso5.gif) Animation tips ~~~~~~~~~~~~~~ The following section will be a collection of tips for creating animation for your cutout rigs. For more information on how the animation system in Godot works, see `doc_introduction_animation`. Setting keyframes and excluding properties ------------------------------------------ Special contextual elements appear in the top toolbar when the animation editor window is open: ![](img/tuto_cutout20.png) The key button inserts location, rotation, and scale keyframes for the selected objects or bones at the current playhead position. The "loc", "rot", and "scl" toggle buttons to the left of the key button modify its function, allowing you to specify which of the three properties keyframes will be created for. Here's an illustration of how this can be useful: Imagine you have a node which already has two keyframes animating its scale only. You want to add an overlapping rotation movement to the same node. The rotation movement should begin and end at different times from the scale change that's already set up. You can use the toggle buttons to have only rotation information added when you add a new keyframe. This way, you can avoid adding unwanted scale keyframes which would disrupt the existing scale animation. Creating a rest pose ~~~~~~~~~~~~~~~~~~~~ Think of a rest pose as a default pose that your cutout rig should be set to when no other pose is active in your game. Create a rest pose as follows: 1. Make sure the rig parts are positioned in what looks like a "resting" arrangement. 2. Create a new animation, rename it "rest". 3. Select all nodes in your rig (box selection should work fine). 4. Make sure the "loc", "rot", and "scl" toggle buttons are all active in the toolbar. 5. Press the key button. Keys will be inserted for all selected parts storing their current arrangement. This pose can now be recalled when necessary in your game by playing the "rest" animation you've created. ![](img/tuto_cutout21.png) Modifying rotation only ~~~~~~~~~~~~~~~~~~~~~~~ When animating a cutout rig, often it's only the rotation of the nodes that needs to change. Location and scale are rarely used. So when inserting keys, you might find it convenient to have only the "rot" toggle active most of the time: ![](img/tuto_cutout22.png) This will avoid the creation of unwanted animation tracks for position and scale. Keyframing IK chains ~~~~~~~~~~~~~~~~~~~~ When editing IK chains, it's not necessary to select the whole chain to add keyframes. Selecting the endpoint of the chain and inserting a keyframe will automatically insert keyframes for all other parts of the chain too. Visually move a sprite behind its parent ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sometimes it is necessary to have a node change its visual depth relative to its parent node during an animation. Think of a character facing the camera, who pulls something out from behind his back and holds it out in front of him. During this animation the whole arm and the object in his hand would need to change their visual depth relative to the body of the character. To help with this there's a keyframable "Behind Parent" property on all Node2D-inheriting nodes. When planning your rig, think about the movements it will need to perform and give some thought to how you'll use "Behind Parent" and/or RemoteTransform2D nodes. They provide overlapping functionality. ![](img/tuto_cutout23.png) Setting easing curves for multiple keys ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To apply the same easing curve to multiple keyframes at once: 1. Select the relevant keys. 2. Click on the pencil icon in the bottom right of the animation panel. This will open the transition editor. 3. In the transition editor, click on the desired curve to apply it. ![](img/tuto_cutout24.png) 2D Skeletal deform ~~~~~~~~~~~~~~~~~~ Skeletal deform can be used to augment a cutout rig, allowing single pieces to deform organically (e.g. antennae that wobble as an insect character walks). This process is described in a `separate tutorial ( doc_2d_skeletons )`.