3DCrafter Plus/Pro - hierarchy animation

3DCrafter Plus 5.0 and up
3DCrafter Pro 4.22 and up

 

Overview

From version 4.22 on, the 3DCrafter X export format has been adjusted to be more friendly to other applications. So it is possible to import 3DCrafter X animations from 3D Exploration (www.righthemisphere.com), from 3D RAD (www.3drad.com), and possibly many other applications that are not able to understand some X features previously used by Canvas.
Plus, from version 4.22 is possible to export a X animation by selecting the hierarchy from a frame, instead of selecting it from a shape. So it possible to export a frame containing other frames but no shapes, this can be very useful in some situations as we're going to see.
This tutorial is going to show how to create a nice hierarchical walk animation. A simple low-poly model will be used to illustrate in details the techniques used here. The name of the model is Miko, I did it some time ago, it's not very good, but if you like it you can use it in your works, it's free and you can modify the model and the animation as you like. You can find this tutorial and other interesting game developing resources at
www.theothersideworks.com.

As always, I would like to thank Amabilis (www.amabilis.com) for their very clever and kind customer support. And for having so much patience in translating my cumbersome requests into something useful for all the 3DCrafter community. Many many thanks again Richard ! I would also thank XelaG of the 3DCrafter forum (www.imatowns.com/xelagot), for his many advices about how to use the powerful 3DCrafter tools at their best. This tutorial would not be possible without his contribution. Many thanks Alex !

You can find in the tutorial folder two versions of Miko in the native 3DCrafter format.

miko.3dc The model without animations, in its basic standing pose.
miko-anim.3dc The model with the walk animation.

 

Setting up the grid

Before beginning the working session, I would suggest to change the default 3DCrafter grid settings. Go to the Tools->Options menu and set X = -5 and Z = -5 in the grid parameters. This will bring the center of the grid to the center of the scene, so that our grid-centered animations will not be shifted when exporting. Then right-click on the view and choose Look At Scene from the view pop-up menu. If you use more than one view do this for each view. From this time on, 3DCrafter will use a grid centered on the scene. The following picture shows a perspective view centered on the scene, you can see the default 3DCrafter directional lights and the scene axis at the center of the grid.

centering the grid on the scene

 

Adjusting shape axis

When designing a hierarchical animation, the frst thing to do is to setup the axis of each shape in the hierarchy so that the shape rotates around its natural point of rotation. It may be useful too to setup each shape axis so that the axis represent the natural direction of the shape.

Be aware that the position and orientation of the whole animation is given by the scene axis, and not by the model axis itself, so when you export an animated model its position is identified by the scene axis. To export movements relative to the scene axis be sure to reply yes to the "export root frame animation" question of the exporter. Usually, game SDKs based on DirectX, use characters looking toward the positive Z axis, and having their (0,0,0) coordinates at the axis origin. This is true both for Darkbasic www.darkbasic.com and 3D RAD www.3drad.com. The following picture shows the correct Miko position and orientation for a game SDK exporting. The root frame axis is centered on the scene and the model is oriented toward the positive Z axis of the scene.

positioning and orientating the model for game SDKs exporting

To position a shape axis you can use the shift tool. From version 4.21 on, it is also possible to use the ctrl-click variant of the shift tool to move the axis without moving the shape itself, this is much more user friendly for axis positioning. From version 5.0 on, you can use the edit control of the shift tool both to move and rotate the axis, so you have a nice and easy way to handle it. If you need a precise position and orientation of the shape, you can use the shape Properties panel, that you can access from the Properties pop-up menu appearing by right-clicking on the shape itself. Be aware that from this panel you can only move and rotate the shape itself, and not its axis alone. The following picture shows the axis position and orientation for the head of Miko. The axis is shifted to the bottom of the head, so it rotates around the natural neck point. Moreover the axis is oriented so that the head looks toward the positive Z axis, this gives to the head a correct orientation in a game SDK. You should do the same for every shape in your hierarchical model.

positioning and orientating a shape axis

Please note that orientating the axis is not needed if you don't use this information during animation or game developement. While positioning the axis is always needed to have correct rotation keyframes during the animation. Also, be aware that finding the correct point of rotation of any hierarchical shape is usually not an easy job. Building the hierarchy and animating is relatively easy, but having the correct center of rotation for any shape is very important for the animation keyframes to work properly.

 

Building the hierarchy

Once you correctly setup all the shape axis, the powerful hierarchy panel of 3DCrafter makes building the hierarchy a very easy task. You just have to drag and drop the child shape frame over the parent shape frame to create a parent-child hierarchy between two shapes. When you create a parent-child hierarchy the parent frame becomes the reference for the child too, so if you move or rotate the parent shape then the child is moved or rotated with it. This is the principle of hierarchy animation.

Let's see in detail how to build the hierarchy for the right arm of Miko. First you have to drag and drop the hand frame (r-hand) over the forearm frame (r-arm2), so when you move and rotate the forearm (that is the parent) the hand is moved and rotated with it, while when you rotate the hand (that is the child) it rotates alone. Then you have to drag and drop the forearm frame (r-arm2) over the arm frame (r-arm1) and the job is done. By following this principle you can build the hierarchy for the whole model. You can use the included miko.3dc model as reference for your training.
The picture below shows the hierarchy and the shape together, the forearm is selected, it moves relatively to its arm while its hand moves with it.

building the hierarchy for the right arm

Well, now we're going to see a useful trick for building a hierarchy for easy animation. It consist in using frames that are not from any part of the model itself, but they contains placeholder elements that we may call "nails", These nails can be really useful to greatly simplify the animation job.

If you look at the Miko hierarchy you'll notice that I used a top level frame containing a cube and I called the cube "nail". We can use this nail to move the whole model during the animation. Please note that each part of the model has its own axis that is needed for its own animation, so there is not any subpart of the model that can be used in a natural way to move the whole model.
Suppose that we don't use the nail and that we use the body shape instead to position the whole model. Then it happens that when we rotate the body, the whole model is rotated with it, that is, we loose the body animation independence from the other parts of the model. The same is true for any other part of the model.

Having a nail permits to independently animating any part of the model while having a way to move and rotate the whole model itself. In very complex hierarchies it is useful to have nails even at the subhierarchy level. So it is possible to have hierarchies having more than one nail.
Generally speaking, you need a nail every time that you need to animate a hierarchy or subhierarchy at a whole, and you cannot identify the natural axis of the hierarchy or subhierarchy with any shape axis in the hierarchy or subhierarchy. This is exactly the case of the whole model hierarchy, that has its natural axis at the ground, between the feet, and that cannot be identified with any existing part of the model.
The picture below shows the entire hierarchy structure of Miko, you can see the nail at the bottom of the model.

the whole Miko hierarchy structure and its nail

For the sake of completeness I would add that it is always possible to avoid the use of nails. For example, if we use the body instead of the nail, then it is true that we loose the capability to animate the body independently from the other parts of the shape, but we can always adjust every other part of the shape every time that we move the body. To bring this example to its extreme, we could also animate without any hierarchy simply positioning each single shape in the scene at each frame of the animation. Of course this method greatly increase the complexity of the animation job, because we have no more a natural and easy way to animate the model. This is why it is important to setup nails in your animations.

Also, please note that the Miko hierarchy structure is optimized for "legs based" actions. The legs are independent from the body while the arms are inside the body frame, so when we move the body the arms move with it. This is a natural way of building a hierarchy for a legs based humanoid structure. But what happens if we would like Miko to walk on her hands ? The entire hierarchy structure would need to be redesigned from scratch in order to have a natural way of animating it. This is the known limit of hierarchy animation, and this is one of the reasons because nailed inverse kinematics was born. With nailed inverse kinematics you can move the nail (or nails) in any place that you like in the kinematics chain, while in hierarchy animations the nail (or nails) are fixed.
Ok, ok, I know this is a tutorial on hierarchy animation, I only told this because it may be useful to know the limits of the tools we use. However, in many cases simple hierarchy animation works well, so it is not lost time to learn about it. Now go on with the most of the fun.. animation !

 

Animating the hierarchy

You will not believe how easy and fast it is to animate your models using the animation capabilities of 3DCrafter. It is just a matter of posing the model into some important points of the animation timeline, then the powerful 3DCrafter animation system will interpolate the poses and will create the entire animation for us.

Before going on with the animation, I would suggest changing the default animation settings of 3DCrafter. Click on the Animate button of the animation bar, then click on the Animation Properties button and change the Keys Per Second parameter to 30. This way we can set up to 30 keyframes (model poses) for each second of animation. Since many modelers and viewers have a default blayback speed of 30 frames per second, this makes our animations more portable among other applications. For example 3D Exploration (www.righthemisphere.com) and 3D RAD (www.3drad.com) both use 30 frames per second as their default playback speed.

changing the animation speed to 30 frames per second

Well, now it comes the real fun, to plan and to realize the animation itself. For our example I decided to design a simple walk animation. The first pose in the animation timeline will be equal to the last pose in the animation timeline, this way the animation can be cycled seamlessly. This could be an important feature if we plan to realize animations for a game SDK. The entire walking cycle will need about two seconds to complete (left step plus right step), so the Animation Keys parameter in the Animation Properties window can be set to 60.

The first pose of the animation will be set at keyframe 0. Probably in a game this pose would be started from a idle animation, so it would be better to design the pose so that it is not too much different from a natural standing pose. To design a pose simply select on the hierarchy panel the part of the body that you want to move, then move it using the standard edit control on the bottom right of any view. Do this for each part of the model until you are satisfied with the result. You can use the included miko-anim.3dc model as reference for your training. We'll later set the last pose of the animation, at frame 60, so that it is equal to this first pose.

posing the starting position of the model

You could not believe it, but to realize the entire walking cycle we only need to specify four poses of the model. To specify more poses is not useful at all, because in any case 3DCrafter can interpolate them for us. So how could you know how many poses are needed, and at what point in the timeline you need them ? Well, this is an art, it's not hard to learn it though, and after some training, and a lot of try and error, you'll be able to understand what the important poses are in your animation, and what poses you can leave to the interpolator. You could imagine to be an artist drawing an animation sequence on a sketchbook, there are some poses that you absolutely whant that way, so you must specify them, while you can leave to the interpolator the intermediate poses that you don't care about.
The picture below shows the four poses of the walking animation, they are at frame 0,15,30 and 45, the last pose at frame 60 is equal to the first pose at frame 0. To set a pose is very simple, first go to the frame that you want to change using the Animation Position slider at the end of the animation toolbar, then pose the model. When you are done, move the slider to the next frame and pose the model again, and so on.

the four poses for the entire walking cycle

Please note that not only the legs are moved, but the arms and the head too, moreover the nail is used to move the whole model up and down as the walking cycle goes on.
If you are not satisfied with a certain pose, you can always modify it later. Move the slider to the pose frame and adjust your pose. The 3DCrafter animation system registers all the changes automatically and you really do not have to care about single keyframes management for each subpart of the model.

 

Final notes

Well, we got the end. Now we have a nice walking cycle. Before exporting it to X format you have to remove the nail, so that it doesn't appear in the exported model. Select it in the hierarchy editor and delete it using the Delete function. This leaves you with an empty top level frame containing other frames but no shapes. Right-click on the top level empty frame labeled "miko" and choose Export Selection->DirectX Frame Hierarchy from the pop-up menu.

Please note that before the 4.22 version of 3DCrafter it is not possible to export from frames, because you can only access the pop-up export menu from a shape. A workaround for previous versions is to don't use nails, or to use nails that are total transparent shapes, so that they are invisible in the exported animation. Unfortunately many game engines have problems in correctly managing alpha blended shapes, so the less they are the best it is, and the practice to export model containing unuseful transparent shapes is not adviceable.

 

As always, comments and suggestions are very welcome.. alex@theothersideworks.com