Monthly Archives: February 2019


Character Creator 3: Head Separation with Morph Preservation in 3DS Max

For my current work, I use Reallusion’s Character Creator 3 for my humanoid characters. They offer a lot of customization, are rigged and skinned, and come with a variety of morphs for facial expressions and lip syncing. One issue, however, is that because I am using these characters in a game engine — in this case Unity3D — the morphs are a bit problematic.

Morphs or Blendshapes are composed of vertex data describing translation of vertices between different blendshapes. You can then interpolate between these shapes to get a variety of small changes in the model.

The entire body mesh uses the morph but most targets just affect the face.

For Character Creator 3 models though, because the head and body are part of the same mesh, the morph data has a lot of empty space for all of the vertices from the neck down that do not move. This post goes over the process I use to

  • Separate the head mesh from the body mesh
  • Reapply morph targets to the head mesh
  • Reskin the separated head and body meshes

Note, these methods utilize 3DS Max; however, they can probably also be done in Blender or Maya using tools that those programs utilize.

Separating the Head and Body

The first part of this process includes separating the head and the body. By default, CC3 characters’ head and body are setup between different sub meshes; unfortunately, you can’t simply just use the head submesh and separated that as some morphs affect vertices in the torso’s submesh.

The first thing I do is copy the original mesh. These processes can cause some issues, so always make sure to have a version of the original mesh just in case something goes awry and you have to start over.

Selecting the Right “Loop”

In the duplicated mesh, I ADD an edit poly modifier. I want the original skinning and morph modifiers to remain. I’ll explain why later. Then, I try to select an edge loop that I’m sure is not affected by any of the morphs. In fact, if you character is clothed selecting an edge loop that is hidden or obscured by clothing would probably be a good idea.

Some morphs affect the neck slightly, so separating the head from the body at the base of the jaw could cause issues.

The goal of this is to eliminate as many unused vertices as possible, not all of them.

This edge loop is hidden by most of the shirt, which is hidden for demoing purposes.

Once the edge loop is selected, press “Split” in the edit poly panel. This will make the torso and the head separate elements. I then select the head elements as well as the eyelashes as they are considered separated elements but are also affected by the head’s morphs — and “Detach” the element from the body as a new mesh.

The body (red wireframe) and body (blue wireframe) separated.

The head and body have now been separated. In fact, the morphs on the removed head still work; however, the skin modifier data is no longer valid. This is because the number of vertices has been altered.

Hair-raising problems

Preserving the Morphs

Despite the morphs still working, they essentially contain the old morph data, the unused vertices we are trying to eliminate.

I wrote a maxscript to preserve this data. It can be downloaded here. To use the script, select the head mesh and then run the maxscript.

What this script does is essentially recreate every morph target but only for the head. Once this script is finishing executing, there will be a new, duplicated head mesh with only the morph modifier on it.

The new head mesh with no skinning

Reapplying Skinning Data with Skin Wrap

So now that the body and head mesh with new morphs have been created, we need to reapply the skinning data. For the first step, I right-click the body mesh and convert it to an edit poly. So, before starting the next step, we should have two meshes. The head mesh with just morph modifier and the body with no additional modifiers.

Anyway, select the body mesh and add a Skin Wrap modifier. This modifier essentially uses vertex positioning to recreate skinning from one mesh to another. In this case we are essentially copying the data from the original mesh to the new mesh. The following are the settings I use to accomplish this:

Skin Wrap Setup

Once the settings are defined, select the original CC3 mesh to copy over its skinning data to this new mesh. Once copied over, you can create a new skin modifier by pressing “button”. This will disable the Skin Wrap modifier and automatically add a skin modifier.

Repeat this process for the head, making sure that the morph modifier is beneath Skin Wrap modifier.

Once done, the head and body should now be separated, the morphs only applied to the head, and both skinned properly and identically to the original CC3 mesh.

Conclusion

In conclusion, these steps should help separate CC3 character heads and bodies while preserving morph targets and skinning data. This is a rather short process, but I hope one day CC3’s exports options include a way to separate meshes on export so this process is already taken care of. In the meantime, hopefully this will be useful for someone working with CC3 and importing their characters into a game engine. Again, here is the link for the Morph Preserve maxscript used during this process.


Maxscript: Constrain to Biped 2.0 6

Two years ago, I wrote a post about a maxscript I had written that constrains a humanoid rig to the 3D Studio Max’s biped. Recently, I’ve been working on a fighitng game prototype. I’m using animations from an asset package for this, and though the animations are very nice, there are sometimes things missing or I wish I could make certain tweaks. I said to myself, “I wish there was a way to record these animations so I could edit them more easily.”

I know you can import a .fbx file, the format of the aforementioned animations, into 3DS Max, but every frame is keyed and making edits is rather difficult. I could try and use animation layers, but if I want to apply the animation to a different character, this can’t really be done either.

So, remembering the script I wrote awhile ago, I figured I would try and make a version, so I could record animations. At the same time, one issue with the previous script was that when using it, it forced the original rig to rotate so it would fit the biped. This would cause this strange “bulging” in various areas that some users, including myself, didn’t care for.

Before rigging [left] / After rigging [right]

Most of this is due to the fact that not all rigs are not perfectly aligned like the biped so when going from a rig’s t-pose to the biped’s, the rotation done to conform the rig to the biped results in some rotations that otherwise, the original rig wouldn’t utilize.

The New Script

Version 2.0

This new version has a few changes compared to the original:

  • The bone selection area has been separated into two columns for easier organization
  • The addition of a lot of new features and buttons
    • Quick Midpoint – creates a new midpoint between selected objects
    • Quick Connector – creates a new bone that connects two selected objects
    • Foot Angle Adjustment in Degrees: An angle, measured in degrees, used to more correctly size the created biped’s foot
    • Turn Figure Mode Off: A toggle button that turns figure mode on and off
    • Alignment Tools and Animation Recording, both of which will be explained later

How to Use

Preparing the Rig

So, like the original version, you start off by preparing the rig. You have to add make sure that all bones (besides the infamous bone #7) are assigned properly. This can be done using tools such as quick child.

Determining Foot Angle

One new value that should be assigned is Foot Angle Adjustment in Degrees. This value is used to determine how big to make the biped’s foot and when aligning the biped’s foot to the original rig’s, how much to rotate it back so it matches the original rig’s foot angle.

One way to determine this value is to go into rotation mode and the view coordinate system and select the original rig’s foot bone.

Here, my rotation values are -12.979, -0.169, and 172.337. The biped’s foot will always be rotated positively on its z axis, so for this rig, I would use 12.979 for this value. This can be a little trial and error unfortunately, but as long as this value isn’t changed after building the biped, the toes should stay aligned properly.

Building the Biped

Once all of the bones are assigned and the rig is validated, the biped can be built. You’ll notice that when doing so a “FAUX_RIG” is created as well as the creation of a bunch of dummy objects. These dummy objects are used to align the biped to your rig.

New biped and “faux rig”
Small spheres are also added to the top of the biped’s fingers to help indicate the “top” of the fingers better.

Aligning the Faux Rig

This, unfortunately, is probably the longest part of this new process. Using the Biped Alignment section, you set the index of the bone you want to edit. Then you click one of the rotate buttons. When time this button is clicked, it’ll realign the associated bone with the newly aligned faux dummy.

How a misaligned biped MAY appear depending on the rig.

Fortunately, every time you do a rotation, it is recorded so you can save it out and reload it at a later time or for new rigs that are similarly oriented.

You can also check the alignment by clicking Align Bone or Align All. Also thighs, calves, upper arms, and fore arms do not need to be aligned since aligning the biped’s hands and feet will automatically align these better.

Another note is that you should stay in figure mode when aligning the first spine bone, the clavicles, neck, head, toes, and fingers. This is because, while in figure mode, these items are all oriented AND positioned. Once out of figure mode, they will not be moveable.

Additional Alignment Notes

If you are doing this from scratch, you should note that the clavicles are rather difficult to rotate while in figure mode. They translate to the proper position but will not align properly, but once out of figure mode, they will. Additionally, because of this, I suggest putting a slight bend in both the original rig’s elbow if possible. Even if the clavicles are off a bit, if the hands can reach the original rig’s, they and the fingers will line up properly. This is also useful to do at the knees so after positioning the hands and feet, the rig’s knees and elbows can be positions correctly. If they are too straight, these sometimes will rotate incorrectly.

Aligned rig with slightly bent knees and elbows

Finishing the Rig

Once the rig is aligned properly and figure mode is exited, you can either create constraints, which will add orientation constraints and positions constraints to the original rig so they follow the biped OR record the character’s animation to the biped.

The Key Frame button will do just that, recording the pose of the original rig to the given frame. However, you can also record the entire animation. You can set an interval. An interval of 1 means it will records every frame. An interval of 2 means it will record every other frame, 3 every third, etc.

This process, unfortunately, is rather slow. A 100 frame animation can take almost 10 minutes if every frame is captured, but once finished, the biped’s new animation can be saved to a .bip file and applied or edited.

Final Notes and Areas of Improvement

This script, though usable, could probably use some improvements.

  • Sometimes the script will crash like if you, for example, try to rotate a faux transform without building it first; thus, requiring the user to close the window and rerun the script. Having more error-catching would probably be useful.
  • I think there is a memory leak somewhere; after using the script many times or opening and closing it several times, 3ds may sometimes crash when starting a new project.
  • The alignment process takes awhile in general; I wish there was an easier way to automate this. Fortunately, I’ve created a file for Character Creator 3 rigs that should align the rig properly and quickly after being loaded.
  • Recording animation can be slow.
  • Adding rig automation would be nice so the nubs don’t need to be added manually
  • Foot sizing and placement can still be rather troublesome

Updates

March 31, 2019 – Version 2.0.1

  • Added new button to quickly create nubs for the head, fingers, and feet, since these are usually missing.

Download

You can download the script here for free. If you use my script, credit would be nice but not necessary. Additionally, I would love to see what people do with it. Enjoy!