Accessibility
 
Home / Developer Center / Director Developer Center /

Director Article

Mark McCoy
Mark McCoy
3D Artist / Animator
www.ezupa.com
 
Character Animation for Shockwave3D


There are many strategies for designing characters for Shockwave3D. This article outlines some of the basic concepts for general character setup when developing real-time game environments, as well as specific tips for working with the Shockwave3D exporter for 3D Studio MAX and Character Studio.

Setting up a character for animation requires a significant amount of time and patience. As with many 3D applications, the process outlined below can fail for many reasons. Most likely, your project will involve a lot of tweaking—you may even have to completely start over. Don't be surprised, just be sure to budget extra time for development.

The following information assumes you have a working knowledge of 3D Studio MAX. Please consult the 3D Studio MAX documentation for additional information. One major recommendation: MAX has a Save Incremental feature. Use it. When something goes wrong, you will be able to back up a couple steps. It's much faster than starting over from the very beginning.

The basic process of creating a character involves the following steps:

·
Step 1: Make a mesh
·
Step 2: Texture mapping
·
Step 3: Make a box skeleton
·
Step 4: Make bone skeletons using the boxes
·
Step 5: Link up the hierarchy with bones and dummies
·
Step 6: Add Physique
·
Step 7: Delete the box skeleton
·
Step 8: Tweak the Physique weights
·
Step 9: Test with the Shockwave3D Exporter
·
Step 10: Troubleshoot
·
Step 11: Animate
·
Step 12: Export to Shockwave3D

If you are using 3D Studio MAX 4 or 5 and Character Studio 3, download this source file: GenericGuy_max4.zip (53K)

If you are using 3D Studio MAX 3.1 and Character Studio 2, download this source file: GenericGuy_max3.zip (49K)

 

These steps probably seem familiar if you have worked on setting up characters or game engines before. If you have never created a setup before, get ready for an adventure.

Note: The scope of this document does not cover everything you will need to know to set up a character for the first time. Other resources will be necessary. The MAX help files are particularly useful for researching the concepts discussed below.

Step 1: Make a mesh

The first step to doing character animation is having a character. In order to work with Shockwave3D, the mesh has to be just that: a mesh. Nurbs, patches and Surface tools are not supported. If you have a patch model, it will need to be converted to an editable mesh. Also, for faster development, collapse the modifier stack. Working with the model will be faster in MAX without a hefty stack, especially after you've added Physique.

Before converting or collapsing an existing model, be sure to use the Save Incremental feature. It is helpful to have a recent backup, because you may need to start over. To convert a patch model to an editable mesh or to collapse your modifier stack, right-click on the model and select "Convert to Editable Mesh."

image of a 3D character

Remember that Director and Shockwave are real-time 3D applications. The simpler the geometry, the faster it will download and playback over the Internet. There are many excellent tutorials about modeling available on the web. Try searching for tutorials using the following keywords: low-poly modeling and box modeling. To see more tips on how to create low-polygon characters, visit the 3D Links website.

What to do when good meshes go bad.
This involves troubleshooting to determine the solution. If a model starts behaving strangely (for example, the character moves in the opposite direction as the bones, or it moves twice as far as expected, or it exports upside down, or other strange anomalies), it may be time to reset the transforms. Refer to the MAX help files for ñreset transform utilityî for specific instructions.

Mirroring and Scaling has a tendency to cause display problems in MAX.
If it is absolutely necessary to mirror something, make sure you reset the transforms or attach the model to another piece of geometry. Also, it helps to make all objects in the Top, Perspective, or User view ports. Making objects in other views causes the axis to be aligned differently, which results in irregular performance and makes it difficult to control objects with Lingo.

Step 2: Texture mapping

3D Studio MAX includes many texture mapping features that are not supported in Shockwave3D. A basic summary of the restrictions is represented in the following graphic:

 

3D Studio MAX screen shot

The following items (marked with red ñnoî symbols) are not supported:

·
Texture coordinate adjustments within the Bitmap texture's Coordinates rollout.
·
Texture coordinate adjustments within the Cropping/Placement box of the Bitmap texture's Parameters rollout.
·
Texture coordinates in mapping channels other than channel one.

Use the settings in the UVW Mapping modifier (marked with a green outline) to tweak the size and tiling of your map.

Multiple Map channels are not supported.
If you want to put multiple UVW coordinates on your mesh, you will need to put a Mesh Select modifier on your mesh and select the vertices you want to map. Then, add a UVW Mapping modifier. Repeat this process for each section.

MAXtutor.com contains tutorials which provide further instructions on Multi/Sub-Object material mapping.

Note: Animated texture maps (AVIs, MPEGs, and others) in MAX will not export. If you need to animate maps, you must control them using Lingo in Director.

Step 3: Make a box skeleton

Technically, this step is optional . You can create bones for Shockwave3D without making a box skeleton, but it is not recommended. A well-developed skeleton is much easier to animate. For more information on designing skeletal structure, visit Gamasutra.com to read the article on Anatomically correct character modeling.

Before you make bones in MAX, create a skeleton of boxes. The skeleton should be approximately the same size as your mesh, with joints in the desired locations. These boxes will be used as the foundation when making the bones.

There are two major advantages to using the box skeleton method:

·
It makes the task of placing the bones much easier.
·
It results in better initial envelops in Physique.

When you make bones using the Auto-Boning feature on a box skeleton, an axis of the bones will lie along the bone. In the illustration below, the chain on the left was created using the normal method of clicking in the view port.

 

Make a box skeleton

 

The boxes in the middle show a side view of a box skeleton created for the leg. When you are creating a box skeleton it is important to ensure that the pivots are positioned and aligned as the joints will be.

The chain on the right was created by Auto-Boning a box hierarchy. As you can see, the Z-axis in the chain on the right aligns perfectly with the next bone in the chain.

It is important to have the axis of rotation aligned with the shaft of the child bone. This is especially true when modeling an arm. A well-aligned chain will make the process of animating much easier.

Basically, the concept of building a box skeleton involves making a box for every bone in your model. Make sure the pivot points of the boxes are located where the joints meet. Align the axis of the two boxes to match the direction you want the bone to rotate. Make the boxes slightly larger than your mesh, since Physique will base its envelopes on the size of the boxes.

Link the boxes together with the link tool, following the desired hierarchy. Leave the legs as separate chains and donÍt attach the feet. Stop at the ankle. WeÍll talk more about this later.

 

Character showing hip bones

Note: This box character isn't wearing a cool belt. The purple squares are boxes which serve as his hipbones.

 
Step 4: Make bone skeletons using the boxes

Once the boxes are set up and linked together, start making bones.

Create the bones by ñAuto Boningî the boxes. In the ñCreate Bonesî tab, select the ñPick Rootî button. Click the root of the box chain. The bones that are created will follow the position and hierarchy of your linked boxes. Each box becomes linked to its corresponding bone.

The setup is much more manageable when you work with several different chains. One chain for each leg and arm, one for each foot (starting at the ball of the foot), another chain for the spine and neck, and you may want a number of chains in the face. These chains will become linked together in the next step.

 

Character bones linked together

Many developers prefer to have IK (Inverse Kinematics) only in the legs. Make the upper body FK (Forward Kinematics). FK arms will permit better control over arm movements than an unwieldy IK chain does. Also, IK in the arms tends to give 3D animation a Muppet look, as though the hands are pinned to the ends of sticks.

 

When designing the FK upper body, you will have to use bones that donÍt have an IK controller. When creating the bones for the upper torso, make sure to uncheck the ñAssign To Childrenî checkbox. This will ensure that the bone has a standard Position Rotation Scale controller.

 

Setting bone parameters

If you are an experienced rigger, you should note that link inherits are not supported in Shockwave3D. Using them will cause odd export behavior.

Expressions are supported in Shockwave3D. So, if you are an expression-writing enthusiast, feel free to automate to your heartÍs content.

Shockwave3D has a limit of 9 bones effecting one vertex. Most skeletons will use less, but this limitation should be considered when creating the setup.

Sliding bones are not reliably exported.
If you want the effect of a sliding bone, link a dummy to the end of the bone and link a bone to the dummy. Animate the dummy translating; the effect will be essentially the same as a sliding bone—although the rotation on the dummy will not be exported.

Michael Comet wrote a  helpful tutorial for setting up legs in MAX 3.1. There are a few changes that you have to make, when developing for Shockwave3D. First, to export to Shockwave3D, the root needs to be linked to a dummy, not a geometric object. Second, if you use the FK foot setup (recommended), you need to substitute FK bones for the geometric boxes used in the foot.

Step 5: Link up the hierarchy with bones and dummies

After creating all the various chains of bones, they must be linked into one chain. In order for the bones to work in Shockwave3D, they all need to be part of the same hierarchy. There must be only one bone at the root level.  Multiple root bones are not supported.

The easiest and most compatible method for linking the bones involves using the link tool. Link the chains from the last step together to create one bone chain. Link the arms to the shoulders, the hips to the pelvis, and so on. If you are feeling experimental, you can also try adding dummies to the chain, although there are some limitations. These are discussed in detail below

 

Diagram of how to attach the feet

 

Attaching the feet
Connecting the feet to the chain presents a problem. The feet need to be down the hierarchy from the root in order to export correctly. In a normal setup, the feet would be separate from the root so that they can move independently from the rest of the body. If the pelvis is the root, you still want the feet to move independently from the pelvis.

The solution is to make a new root.

Create a single bone. Actually, you'll have to create two bones, and then delete the second one. Choose the top view port or the perspective view when you create the root, to ensure that its coordinate system is aligned with the world. Place the bone directly underneath the character on the floor. Link the pelvis to the bone, then link the feet to the floor bone.

With this structure, the feet can move independently of the pelvis, while still maintaining a single chain in your setup. (Remember that the end effecter for the ankle is linked to the foot, so that the IK leg will follow the foot.) Putting the root on the floor also makes it much easier to animate the character in Director, because the position of the root wonÍt be bouncing around following the pelvis during a walk cycle.

The other option for attaching the feet involves the ñseamless footî setup, outlined in the Comet tutorial.  If you've tried the first method and you find yourself distracted by the weird bones stretching across the screen, then the connected foot approach is an alternative.

Dummies in the bone chain
It is possible to put dummies in your character setup. The Exporter will use a MAX dummy as a Shockwave3D bone if there is a bone linked to that dummy. This allows you to put dummies in your chain to use as a handle. However, there are some limitations to this approach.

Rotation animation on dummies
The rotation of dummies in the chain will not export properly. Any animation movements added to these dummies will not appear in Shockwave3D.

Also, rotations applied to the bone that is located right after the dummy on a chain are exported incorrectly. Rotation animation on these bones will export with rotations twice as far as the animated model in MAX. Practically speaking, these bones shouldn't have rotational animation either.

To summarize, rotational animation needs to happen on the second bone after a dummy. In other words, the order goes like this:

Dummy (donÍt animate rotation) ö Bone (donÍt animate rotation) ö Bone (Rotate me!)

Dummy Limitations
If you plan on using multiple dummies in your chain, it is important to note that there can only be one dummy between the two bones on the chain.

To successfully import, the grouping needs to be:

Bone ö Dummy ö Bone.

Bone ö Dummy ö Dummy ö Bone will not export properly.

With those limitations in mind, feel free to get really creative with how you set up parts of your character.

When putting dummies in the chain with bones, donÍt align them directly on top of each other. Doing so will cause trouble when trying to add Physique. (Physique stops following the chain when it encounters two nodes on top of each other.)

Step 6: Add Physique

For the most part, adding Physique for Shockwave3D is the same as adding Physique normally. However, there are a few things to keep in mind when setting up Physique for Shockwave3D export:

·

Remember to zero the influence of any of the links that arenÍt going to be exported. (Select the envelope and set the Strength to zero.)

·

You will also want to zero the ñStrengthî of the links that go from the Root on the floor to the Pelvis and feet. Otherwise your character is going to look odd when it moves.

·

Some items that Physique recognizes as bones will not be bones when they export. Physique recognizes anything in the hierarchy as a bone and assigns it a weighting. As stated above, the Exporter will only recognize actual bones, as well as dummies that are linked to a bone and have a bone linked to them.

·

Bulges, tendons, and skin sliding are not supported. These effects wonÍt display in Shockwave3D

·

The algorithm for deforming the mesh in Shockwave3D is different from the methods used in Physique. As a result, the way the mesh deforms in the view port will look slightly different from the exported deformations. 

·

Any modifier on top of Physique that changes the vertex count (such as MeshSmooth or Optimize) will not export. For best results, put any modifiers in the stack below Physique. One exception is the Mesh Select modifier, which is used to assign "base vertices" to the multiresolution Shockwave3D mesh.

General Physique tip
You may encounter a problem where Physique doesnÍt recognize a piece of your skeleton. This is usually a result of a parent and child being exactly lined up with each other. When Physique encounters a child that has the same position as the parent, it stops proceeding down the hierarchy at that point.

Step 7: Delete the box skeleton

At this point, the Boxes used to make the skeleton are no longer needed. Remove them now. Hiding the Boxes does not remove them and they will show up again when you export.

If you forget to remove the Boxes, you will be reminded when you see your box character move around in the Shockwave3D preview window.

Step 8: Tweak the Physique weights

YouÍre going to spend a lot of time tweaking the vertex weights trying to get the mesh to deform the way you want. Budget for the necessary development time.

Step 9: Test with the Shockwave3D Exporter

The only way to verify whether a model works as expected is to test it and find out. Animate some quick motion to see if the mesh is sticking with the skeleton. Export it and check that everything stays together.

The 3D Max Shockwave Exporter is available for download from Discreet's web site.

Step 10: Troubleshoot

Inevitably youÍll have a setup that doesnÍt work out. You can troubleshoot your project by repeating any number of the processes discussed in this article. Some of the more common issues are:

·

If your character is malformed, take a moment to try to figure out which bone is causing the deformity.

·

Make sure the setup is working in MAX. Is Physique recognizing all the bones? Does it look acceptable in the MAX view port?

·

If the setup works in MAX, then verify that the hierarchy is compatible with Shockwave3D. Are the vertices weighted to only Physique links that follow the Shockwave3D rules? (In other words, either a bone link, or a Dummy that is being converted to a bone because it follows the Bone ö Dummy ö Bone format.)

·

Do you have any rotating dummies within the skeletal chain? Those rotations wonÍt export properly.

·

Do you have a rotating bone that is linked to a dummy within the chain? Those rotations will export with twice the rotation as authored. 

·

Does the malfunctioning bone have locks turned on or inherits turned off in the Link Info panel? These selections can cause trouble.

·
Are you using an incompatible controller? Some of MAXÍs more exotic controllers arenÍt supported. (The link controller is one example.)
·
Does it have more than one root bone? In order to export properly, there must only be one root bone. This must be a bone, not a dummy. (The singular root bone can be linked to a dummy, but you can't have two bones linked to that root dummy.)
·
Did you link your character to a different mesh? If the root bone is linked to a mesh, both meshes will appear in the same location. Instead of linking it to a mesh, link it to a dummy, then to a mesh. This combination will export correctly.
·
Check the axes to make sure that they are aligned properly. Mirroring and scaling (meshes or bones) can sometimes create axis that point off in a variety of funny directions. This can cause objects to move in unexpected directions or distances when exported. The remedy to this situation is to reset the transforms. Resetting the transforms will severely affect any animation performed, so proceed with caution.
·
Saving in versions saves you time when troubleshooting. Go back a few versions and see if the setup exports correctly. Try to figure out what you did to cause the unexpected results. You may have to redo a little of your work, but at least you donÍt have to start over again from scratch.
·
Subtle movements are lost:  When viewing your animation in the preview window, you may notice that some of the subtle eases in and out or a slight ñmoving holdî doesnÍt appear. This is due to a compression technique used in Shockwave3D to keep animation file sizes down. Unfortunately, there is no work around for this at this time

What if it can't be fixed?
Can you fix it in Lingo? If you are comfortable using Lingo in Director, there may be situations where issues with exported files can be fixed using Lingo. Trying to fix a character animation in Lingo will likely be more effort than it is worth, but other problems can be resolved.

Step 11: Animate

Once you have a working setup, you are ready to animate. Have fun. A solid setup can allow you to create animations for years—assuming you would want to animate the same character for years. Remember to save often.

The exported animation will assume the name of the root of your hierarchy. (This could be a bone, a group, or a mesh.) If you are building a library of motions, you may want to change the name of root to correspond to the motion name, for organization purposes.

When animating, donÍt forget the Principles of Traditional Animation, as outlined on Siggraph's website.

Step 12: Export to Shockwave3D

Once you have created your animation, you are ready to take it into Macromedia Director. From Director, you can create your own 3D interactive widget with character animation. For further details about exporting to Shockwave3D, consult the Macromedia Director documentation.

Note: If you are using 3D Studio MAX 4 and Character Studio 3, make sure to group all nodes that belong to a biped, including all biped parts (such as footsteps). Once these have been grouped together, you can assign a name to the grouped collection. The name you assign the group will determine the name of the exported animation. Consult the exporter documentation for more information.

If you have questions or comments about this article, please join the discussion thread on the Macromedia Director Online Forum titled DevNet: Character Animation for Shockwave 3D.

 

 
About the author
Mark McCoy is a 3D artist/animator turned Shockwave 3D designer. While working for Intel, Mark put the 3D features of Director through its paces from the artist's perspective. Currently working as a freelance 3D artist and designer, he enjoys using Shockwave to add interactivity to 3D animation on the web.