|
ARTIST PIPELINE DOCS: Character Creation (and use of Cal3d/ReplicantBody)
TUT01_MAX 7
The latest version of the Cal3d exporter for Max is bundled with Delta3d 1.0 in the “..\Delta3D\ext\bin\” directory. If you need to download them seperately, you can get them here: Cal3d Exporters
**3DS MAX
***example of the Delta3d character pipeline
1) Install the Cal3d exporter
a) Put the 'cal3d.dll' file (found in “..\Delta3D\ext\bin\”) into the 3d studio max directory.
b) Put the 'cal3d_max_exporter.dle' file (found in “..\Delta3D\ext\bin\max7_plugins”)into the plugins directory of 3d studio max.
2) Build/Rig/Animate
(Don’t worry, I won’t waste anyone’s time here with basic character modeling how-to’s. That’s for another Tutorial)
a) There are some Cal3d exporter nuances to keep in mind when setting up your character. Each material on the character you create must have its own slot in the material editor and be tagged with numbers in sequential order. Ie:
legs [0] // arms [1] // head [2] // body [3] // etc……
3) Export
IMPORTANT NOTE: cal3d exports 4 files 2 different ways...(csf,cmf,crf,caf) OR (xsf,xmf,xrf,xaf)...Max's default is the "csf" version, but you can choose either by typing in the extention yourself, or changing the extension after export. The sample Configure file and Rbody file below assume the use of the binary "csf" version. That being said.....
a) For the cal3d export to work correctly you MUST export the Skeleton first (followed by the mesh(s), material(s), and animation(s) in any order you choose)
b) Select your Biped’s Center of Mass and click Export from the File Menu. Select the Cal3D skeleton exporter, enter a name for the skeleton, and you’ll see a checklist of all the bones in your Biped. Each bone in the hierarchy should be checked once. Click finish and the skeleton file is exported.
c) Next, you’ll export the Mesh(s) that make up you character…one at a time. Select an individual mesh object, click Export from the File Menu and select the Cal3d mesh exporter. A dialog box will ask you to select the skeleton file you already exported. Click Next and choose your LOD options. Click Next and choose your Spring setting options (still experimental). Click Finished and you are done with that mesh. Repeat this step for each mesh that makes up your character.
d) To export the materials, click on Export from the File Menu and select the Cal3d material exporter. A dialog box will list the materials matching Cal3d’s requirements. Select one of the listed materials and click next. If there was a texture map attached to that material you will now be asked to select it. Then click next.
e) Next step is to export the animation(s) you have created. Click on Export from the File Menu and select the Cal3d animation exporter. A dialog box will ask you to select the skeleton file you already exported. Click next and you will get a checklist of all the bones in your Biped (just like during the skeleton export). Make your selections and click next to get to the last of the export options. In this dialog box you can set the animation frames, displacement, and speed.
4) Create the Cal3d “.cfg” file for the exported data
a) Using any text editor you wish, will now need to create a .cfg file containing all the information about the files that make up your character. The most important thing to remember when creating this file is to list the materials in the same order you tagged them in max [0] is first, [1] is second…and so on.
Below is a sample “.cfg” script to use as a reference:
################################################
## Skeleton - Cal3d cfg File
################################################
scale=0.5
################# Skeleton #################
skeleton=humanTEST.csf
################# Meshes #################
mesh=humanTEST.cmf
################# Animations #################
animation=human_RunAnim.caf
animation=human_WalkAnim.caf
################# Materials #################
material=LegMaterial00.crf
material=ArmMaterial01.crf
material=HeadMaterial02.crf
material=BodyMaterial03.crf
5) View your animated character
a) Download the free Cal3d mini-viewer from the same site as the exporters: Cal3d Miniviewers
b) Unzip the package to a local directory like "c:\cal3d_viewer" and you’ll see a few miniviewer executables to use.
c) Open a command prompt and change directories until you are in the cal3d_viewer directory you just created. Run the viewer by typing the line: “cal3d_miniviewer_gl.exe c:\DtArtWorkspace\cal3dTest\test.cfg” (replace c:\DtArtWorkspace\cal3dTest\test.cfg with the path to your recently created “.cfg” file)
…Alternately, you can create a shortcut to the viewer executable and dran-n-drop the “.cfg” file onto it.
d) With a little luck you should be seeing your animated character looping in a viewer.
6) Create a ReplicantBody (.rbody) and Character (.char) file
a) After a successful Cal3d export with a working “.cfg” file, you will have to make a new Replicant Body file for the character to be used inside of Delta3D. The Replicant Body file is very similar to the “.cfg” file, but with far more detail added for animation timing, blending, etc.
b) Using any text editor you wish, will now need to create a “.rbody” file containing all the information about the files that make up your character. Below is a sample “.rbody” to use as a reference:
###################################
## Replicant Body Template
##
## All Cal3D data files should be stored in the same directory
###################################
path “./” # (“path to Cal3D data files”)
skeleton “humanTEST.cfg” # (“name of Cal3D skeleton data file”)
default_act "ACT_WALK" # ("action to use at startup")
scale 0.025 # (Scaling to use)
foot_offset offset_float # (Distance between foot bone and ground)
###################################
## Bones used when calculating character speed
###################################
ContactBones {
bone_name "Skeleton R Foot" # ("name of bone in skeleton")
bone_name "Skeleton L Foot" # ("name of bone in skeleton")
}
###################################
## Bones from which you can get the direction
###################################
DirectionBones {
head_bone "Skeleton Head" # ("name of bone in skeleton")
} ###################################
## A core character can consist of several animations
##
## Each animation is connected to an action name
##
## It is the action name that is used when refering to
## an animation/animation type
###################################
Animation {
name “run” # (“name of animation”)
filename “human_RunAnim.caf” # ("name of cal3d file with animation”)
act_name “ACT_RUN” # ("name of action connected to")
act_weight 1 # (Default is 1)
speed 2 # (Default is 0)
is_looped 1 # (0 if non-looping)
is_default 0 # (0 if not default)
}
Animation {
name “walk” # (“name of animation”)
filename “human_WalkAnim.caf” # ("name of cal3d file with animation”)
act_name “ACT_WALK” # ("name of action connected to")
act_weight 1 # (Default is 1)
speed 2 # (Default is 0)
is_looped 1 # (0 if non-looping)
is_default 0 # (0 if not default)
}
##################################
## AnimationDegree is used to combine two actions
## that are executed in different directions
##
## For example, a simple "look at" can be done by specifying
## an animation of head bone turned right as animation 1 with
## "degree" set to 90 (the animation must have at least 2 frames)
## Animation 2 should then contain an animation with head bone
## turned left and "degree" should be set to -90
##################################
AnimationDegree {
name “head_turn” # (“name of animation”)
act_name “ACT_LOOK” # (“name of action connected to”)
act_weight 1 # (Default is 1)
Animation {
name “head_left” # (“name of animation 1”)
degree 90 # (angle_representat_of_anim_1)
}
Animation {
name “head_right” # (“name of animation 2”)
degree -90 # (angle_representat_of_anim_2)
}
}
##################################
## AnimationSpeed is used the same way as AnimationDegree
## but in this case the speed can be varied
##################################
AnimationSpeed {
name “head_turn_speed” # (“name of animation”)
act_name “ACT_LOOK_SPEED” # (“name of action connected to”)
act_weight 1 # (Default is 1)
default_speed 0.5 # (Default is 0)
Animation {
name “head_left” # (“name of animation 1”)
degree 90 # (angle_representat_of_anim_1)
}
Animation {
name “head_right” # (“name of animation 2”)
degree -90 # (angle_representat_of_anim_2)
}
}
##################################
## AnimationBlend can contain two or more animations
## The sum of all animations’ weights should add up to 1
##################################
AnimationBlend {
name “walk_salute” # (“name of animation”)
act_name “ACT_WALK_SALUTE” # (“name of action connected to”)
act_weight 1 # (Default is 1)
Animation {
name “human_WalkAnim” # (“name of animation 1”)
weight 0.5 # (blend_weight_of_anim_1)
}
Animation {
name “salute” # (“name of animation 2”)
weight 0.5 # (blend_weight_of_anim_2)
}
}
##################################
## AnimationScript can have one or more animations
## start_time is only used when the animations are
## treated as prioritized. Other animations are queued
##################################
AnimationScript {
name “headturn_salute” # (“name of animation”)
act_name “ACT_HEADTURN_SALUTE” # (“name of action connected to”)
act_weight 1 # (Default is 1)
Animation {
name “head_left” # (“name of animation 1”)
start_time 0 # (start_time_of_anim_1)
}
Animation {
name “salute” # (“name of animation 2”)
start_time 0.5 # (start_time_of_anim_2)
}
}
##################################
## A core character can consist of several meshes
##################################
Mesh {
name “body” # (“name of mesh”)
filename “humanTEST.cmf” # (“name of Cal3D data file with mesh”)
is_default 1 # (0 if not default)
}
##################################
## The materials get their material ids in the order
## they are loaded. Thus, the first loaded material
## gets id 0, the second gets id 1, and so on
##################################
Material {
filename “humanTEST.crf” # (“name of Cal3D file with material”)
}
##################################
## A material set is used to connect thread ids
## (which get their id parsing by their name for
## a figure in 3DS) to material ids
##################################
MaterialSet {
name “original” # (“name of material set”)
is_default 1 # (0 if not default)
Connection {
thread_id 0 # (thread_id_int)
material_id 0 # (material_id_int)
}
}
##################################
## Conflicting Actions are 2 or more animations which
## cannot be executed at the same time.
##################################
ConflictingActions {
action_1 “ACT_RUN” # (“name of action 1”)
action_2 “ACT_RUN_BACKWARD” # (“name of action 2”)
}
##################################
## The InBetweenActivity is used to transition
## smoothly between different activities, that is,
## use another activity in-between if their end
## and start poses differs dramatically
##################################
InBetweenActivity {
start_activity "ACT_WALK" # (“name of start activity”)
end_activity "ACT_SPRINT" # (“name of end activity”)
inbetween_activity "ACT_RUN" # (“name of inbetween activity”)
}
7) View/Cycle your animated character in Delta3d
a) If all has gone well you should be able to load and view your .rbody character inside of the Delta3d viewer or in Delta3D STAGE.
3DStudio Max: http://www.autodesk.com/3dsmax
Cal3d: http://cal3d.sourceforge.net/
ReplicantBody: http://www.vrlab.umu.se/research/replicantbody/
|