To complete this tutorial we will now be moving into CRYENGINE. We'll be using the Character Tool and the character attachment system within.
If you want some files for reference, please download and unzip the tutorial files as described on this page.
From the last section you should have these files exported:
In this section we will go through the process how to get the *.chr file into the "SkeletonList.xml", create a new character, extend the the new character with a pony tail "Skin Attachment", before we go into the next section just demonstrating the Character Tool's attachment system with some use cases. By the end you will have:
Fire up Sandbox Editor and open the Character Tool. Add the exported *.chr file to the SkeletonList.xml.
From engine version 5.6 onwards, the skeleton list is not used anymore, so you can ignore any references to it on this page.
Pic1: Add the exported *.CHR skeleton file to the "SkeletonList.xml"
Look at the pane on the left of Character Tool. You will find your new character CDF file under:
Characters -> Objects -> jigglebone_tutorial_maya\attachment_ponytail.cdf.
Double-click it to open the character. Notice the asterisk in front of name?
On the right pane the properties of the CDF is displayed, there browse for the *.chr you exported and added to the "SkeletonList.xml":
Pic5: Add the skeleton again to the CDF
For each joint of the pony tail taking part in the simulation, we will add a "Joint Attachment" in your character's CDF. Look at the pony tail joint names. We prefixed them with "sim". So, for these specified joints please:
- Activate the "Redirect to Joint" checkbox, repeat this for each subsequent simulation joint
- A unique name must be given to each Joint Attachment, repeat this for each subsequent simulation joint
- Browse and point to the joint/bone skinned to the pony tail geometry, repeat this for each subsequent child joint going from root to its leaf joint
- Choose the Simulation type: "Pendulum Cone" for each Joint Attachment
Pic11: How to activate the physics of the Attachment System
Make sure you have set these five areas correctly.
Next we'll be playing with the settings of the "Pendulum Cone" physics. In the next we'll explain section which parameters make the big changes.
Before we dig deeper into the simulation parameters, let's change the layout for the properties on the right side of the Character Tool window. This is an important step to be able to tweak the values across multiple "Joint Attachments" concurrently.
Pic13: Split the right pane in the Properties section into two right and left halves
Try selecting multiple Joint Attachments on the left and make changes for the same parameter in the right. Cool, eh?
Pic14: Always use this layout for tweaking parameter across several attachments
In addition, you should turn on/off the debug view when you make changes to the simulation parameters:
Pic15: Debug View
(File: attachment_ponytail.cdf)
First, pendulum physics will produce only rotations to your simulated nodes. If you need translations, use the spring attachments or at least mix the spring and pendulum simulated attachments. You will see bending of the joint chain.
The strategy to change the physics parameters is to only change one of a kind at the same time, ideally starting from the top. For the Pendulum physics system we highlighted the parameter names by using a Blue color.
Pic16: Take special care of these two parameters for each Joint Attachment in the attachment list
All other mentioned parameters are applicable to the other pendulum types: Pendulum Hinge, Pendulum Half Cone, etc.
Try using same parameter values for the simulated joints, especially true with equidistant joints.
If you leave the "Pendulum Cone" simulation joints to the default values, you may want to play with the Damping, Joint Spring and the Cone Angle to get nice results:
use low Damping values around 0.3 in 0.05 steps.
start with Joint Spring values around 20 and advance in steps of plus/minus 5.
increase the Cone Angle, if the simulation becomes jerky. Re-evaluate Damping and Joint Spring.
(File: attachment_antenna.cdf)
First, spring physics will produce only translations. If you need rotations, get the pendulum or at least mix the spring and pendulum simulated attachments.
You will see stretching of the joint chain, along with them translated each on a disk or ellipsoid shape, when using this simulation type.
Pic18: Example of a "Spring Ellipsoid" simulation setup (File: attachment_antenna.cdf)
Springs are much harder to control than the pendula. Your main goal should be:
Start using same parameter values for the simulated joints, but vary the pendulum length (Simulation Axis) to "stabilize" joints.
With Debug View turned on:
Now play with Stiffness values, in steps of 5, start with 30
(File: attachment_springytail.cdf)
Open the "attachment_springytail.cdf" in the Character Tool.
Perhaps, you may have noticed in the previous Use Case 2, that to offset rotate up the antenna, we added a Pendulum Cone with initial rotation. This way, we could rotate the whole joint chain. Hence, you may have SEVERAL simulations running on ONE joint:
Pic19: Achieve a similar pendula simulation with springs
We used different setup to make a pony tail, but the difference between the CDF using springs and pendula is the following (beside the stretching (translation) of the springs and bending (rotation) of the pendula simulation):
With the springs, the whole joint chain is tilted as the "head joint" (the node that is animated) ends up tilted, while with the pendula, the whole joint chain rotates to point down, as gravity pulls it downwards.
Pic20a & b: Comparing the difference in setups with Springs & Pendula, while in a rest pose
With the spring sample CDF, we added in front of the springs a pendulum simulation joint to offset rotate the joint chain. We could also replicate the pendulum-only setup, by tweaking the value for the pendulum pulled downwards by gravity.
What we achieved in this tutorial: