This tutorial will guide you through the basics of editing in CryMannequin. We will be opening the editor and a setup file called a "preview setup". Then we will be creating & editing fragments, and finally we will look at how to save the changes.
It uses samples that are part of the SDK. Feel free to follow along with the step by step instructions.
The tutorial will use a lot of pictures and a simple color code to distinguish areas to interact with and areas to look at:
Open up the CryMannequin Editor by clicking on the Mannequin icon on the toolbar:
You can also open the CryMannequin Editor from the menu item View -> Open View Pane -> Mannequin Editor.
In order to work in the CryMannequin Editor, we need to load what we call a "preview setup file". This file is not used by the game, but it tells the editor which characters and which mannequin animations to load. When you opened up the mannequin editor it opened the SDK's first-person character preview file by default. For these tutorials we will use other, simpler preview files.
Load up the preview file for the first tutorial, it is called "sdk_tutorial1preview.xml"
The preview file sets a character up similar to how the game does it, but now the character is fully inside this editor.
This is how the editor will look now, though you might need to resize the window a bit to make it fit the image below:
Notice there are two main areas in the editor:
You can configure the default Preview File that is opened when you open the Mannequin Editor in the general preferences panel.
When the game wants to play an animation it will never request the animation file directly. The game will always request it through another name which we call a FragmentID. In this tutorial we start the setup from scratch so no FragmentIDs have been set up yet. Let's create one.
Next we need to enter a name. For this tutorial we pick the name "Idle":
In a real production scenario there might already be lots of FragmentIDs defined and you won't need to create them yourself anymore. Your technical colleagues will inform you whether you need to create FragmentIDs yourself or not and which naming convention to use.
Now the FragmentID Editor will open up. Most of the settings are already correct in here:
Make sure "FullBody" as the default scope. (it should already be selected)
If you forget to select a scope the fragmentID will not work in the editor
Press OK:
In this simple tutorial we have only one of these "scopes", but in a real example your character will likely contain many different ones. Each of these can represent a different 'part' of the mannequin character. It could be an attachment like a weapon you want to animate alongside the main skeleton. Or something more abstract like what technique to use for looking around. Which ones you need to select will depend heavily on the case and whoever set up the character will give you this information. Here is an example how this can look like from the SDK example:
You will now notice that there is a new item in the Fragment Browser called Idle.
You can always access the editor you just closed again using the Edit ID... button (you can open and close it now to try it out).
And next to it is the "Delete ID..." button to delete a FragmentID (including all fragments inside it, though in this tutorial we didn't add any yet).
A FragmentID alone isn't much use if it doesn't refer to your animations somehow. And this is where Fragments come into play. A fragment is a small combination of animations that can be played back as a whole; let's create some to get a feeling for what we mean by that and how it ties into this FragmentID.
There are many ways to create fragments, but possibly the simplest is just dragging an animation on a FragmentID.
First let's find the animation we want to refer to in the Character Editor.
Keep the CryMannequin Editor opened.
Open Character Editor by clicking the icon for it on the main toolbar:
Now we look for the animation.
objects/characters/human/sdk_player/sdk_player.cdf
open (if not, open it through File/Open...).Next drag and drop this animation onto the Idle FragmentID we just created.
The result will be:
Here is a quick overview of how you can review the fragment's animation:
If the sequencing panel is selected (press somewhere in the light grey area) you have access to a couple of keyboard shortcuts too:
Now we can make this fragment more complicated if we wanted to. For example let's drag another animation clip into the fragment:
Your timeline now looks like this, and you notice the animation clip got added:
You can identify the following zones on the timeline now:
Feel free to play around and dragging these clips around on the timeline and seeing how this looks when playing back the resulting animation.
Typically you'd want the second clip to be nicely aligned to the end of the first clip so you don't see any repeating frames. You might also want to increase or decrease the blend-in time. You can do that by dragging the vertical bars marked below:
As remarked above this was just one of the simplest ways of adding fragments. There is also a way that doesn't use drag and drop at all which is good to know about. Let's add another fragment to try this out.
Press the New button in the Fragment Browser to add a new fragment under the currently selected FragmentID:
Notice that the new fragment you just created automatically became another default option for the Idle FragmentID:
This means that whenever the game requests to play Idle, it will now randomly pick one of the two options we have.
The new fragment is also automatically selected into the Fragment Editor (it's a bit hard to see but note that the currently previewed fragment is the one in boldface; you can change the currently previewed fragment by double clicking on a fragment).
Now contrary to above this new fragment will be completely empty. It will not even have an animlayer:
But we can now add an animlayer in the Fullbody scope manually from the right click menu:
Now we have an animlayer we can add an animation clip to it by double clicking on the layer's timeline:
But we're not there yet, now we have a clip but it's empty, which is called a 'None' clip. To add an animation we need to have it selected and then we can set an animation in its properties to the right:
An animation browser window will open and you can now select an animation by double clicking on it:
Now might be a good time to experiment with the other properties of animation clips. One of the most important ones is the 'looping' property. Check it to make the animation clip looping forever:
Note how the clip now takes up the whole timeline and vertical markings appear to show where the animation loops.
See Mannequin Animation Clip Properties for information on the other properties.
Now we can also show how to add multiple layers of animation within one fragment. Add another layer by using the same right click menu item as before:
The number of layers you can add might be limited. In this case you can create 3 layers within the FullBody scope (this is configurable by the person maintaining the scopes).
In these new layers you can put additive or override animations to add extra variation on top of the base layer's animation. Try to recreate something like the following for example. Note how the 'None' on the second layer is used to stop the looping 'melee' clip:
Next to animation we can also sequence 'procedural clips' in a fragment. These can do anything from control alignment or aiming to playing sound. New types can be added easily by programmers when needed.
You cannot just put those procedural clips on animlayers though; you need to create a proclayer (procedural layer) as follows:
Now you can add a procedural clip to the newly created layer by double clicking (just like you did to create an animation clip above)
This is how this newly created "None" procedural clip looks:
Now you can edit its properties and make it do something useful, for example play a sound:
And as before you can add "None" clip to stop a procedural clip. The procedural clip code can, if it wants to, use the blend-in and blend-out time (blend-out time is given by the length of the "None" clip).
Here is how it might look if you stop the sound playing with a None clip:
For PlaySound procedural clips the length of the blend-out period is ignored (the sound system defines its own blend out period), but the period is available to programmers that create procedural clips if needed.
For a list of the procedural clip types, see List of Procedural Clip Types.
Clicking and dragging on a key allows you to move it along the timeline.
The default dragging behavior is to snap to the beginning, end time or blend time of keys (see the Clip Zones).
To snap the key to a time step on the timeline (whether it is seconds or frames), begin dragging the key as usual and then hold down the "Shift" key, this will now clip to the timeline markers and ignore the other keys.
Be aware that "Dragging+Shift" is different from "Shift+Dragging" which will clone a key.
To completely disable snapping behavior begin dragging and then hold down the "Ctrl" key. The key can now be dragged to any point on the timeline without snapping either to other keys or the timeline.
To copy a fragment, drag and drop the fragment using the right mouse button.
Alternatively you can also use the more familiar keyboard shortcuts CTRL+C and CTRL+V.
To delete a fragment, for example the one you just created by copying, use the Delete button while you have the fragment selected.
In the screenshot above note the difference between the selected item (Option 3) and the boldface item which is the one currently displayed in the Fragment Editor (Option 1). Pressing Delete will delete the selected item, in this case Option 3. In any case the action will ask for a confirmation so you can check the name before deleting.
At any time you can save your changes with the Save Changes menu item:
This will open up the Mannequin File Manager.
Here it lists all the files which were modified. You will notice that the changes you did affected more than one file and pressing Save would save all of them.
If you don't want to save a certain file you can select that file in question and press Undo Changes to Selected Files.
To be more correct: the file manager lists all files that look different in memory than on disk. So for example if somebody manually edits one of the CryMannequin files (which is strongly discouraged though!) it is possible that the file will suddenly show up in the file manager. This can be very confusing but it also helps to detect subtle editing errors. Simply save the file again when this happens. This also means that, whenever you manually edit a mannequin file - maybe you merged the file in a version control system? - you have to open up the mannequin editor and load a preview file that uses it to verify your edit. Save without changing anything. If the file you edited shows up simply overwrite it.
If you have the Perforce plugin installed there is some (limited) Perforce integration.
If you forget to save before closing the editor or when files change on disk outside of the editor you will still be reminded and the file manager will pop up.
To end this tutorial, simply press "Undo changes to Selected Files" 3 times (or select the files and press it once).
Now you know how to create and edit fragments, you can continue with the second editor tutorial: Mannequin Editor Tutorial 2 - Tags & Previewing
Or you can read about the concepts we touched: the Preview Setup File (xxxPreview.xml), Fragments, FragmentIDs, Procedural Clips, etc.