| On this page |
There are several Otis muscle and tissue recipes available through the tab menu. These are similar to shelf tools which create networks of nodes for learning purposes and plug and play processes. The Test Geometry: Otto Muscle Transfer recipe provides a template to quickly transfer the anatomical muscle and bone geometry from the Test Geometry: Otto SOP to a biped character with matching skin topology. This creates muscle and bone geometry for your target character without the need to model it manually. The muscles can then be plugged into the Test Geometry: Otto Muscle and Tissue Simulation recipe, a pre-existing muscle simulation setup, instead of needing to be configured from scratch.
This recipe uses a character called Broot as the example target character, sourced from SHFS. It shows how the Muscle Transfer SOP can automatically handle source and target characters of different scales.
Important nodes ¶
These nodes are included in the example. Some other nodes are recommended for further configurations, see Muscle transfer nodes for more information.
MUSCLES, SKELETON_AND_ORGANS, SOURCE_PROXY_SKIN, SOURCE_RENDER_SKIN
These are source geometries unpacked from the Test Geometry: Otto SOP. See Learning and using this example to replace it with your own source geometry. See Required assets for muscle transfer to learn how to prepare your geometry.
broot_proxy_ottotopology
This is the Broot example target proxy skin geometry, with the same topology as Otto’s proxy skin. See Learning and using this example to replace it with your own target geometry.
bone_transfer, muscle_transfer
These Muscle Transfer SOPs transfer the muscle and bone geometry between the characters, using the source and target skin surfaces with matching topology. The bones are transferred first so they can be used as additional inputs for the muscle transfer, giving more control over the result.
Tip
If you want more control over the position of the bones in the transfer, you can use source and target rig skeletons as your second and third Interior Geometry inputs. See Learning and using this example for how to quickly create rig skeletons.
adjust_transfer_target
This subnetwork contains the nodes to adjust your target proxy skin for better transfer results. Instead of modifying the target mesh directly, this recipe stores all adjustments in a separate targetP attribute, using a Rest SOP. This allows the target character’s unmodified shape to be visualized, while the
Muscle Transfer SOP uses the modified target mesh for the transfer. See Learning and using this example for how to visualize the unmodified target mesh from the Muscle Transfer SOP.
edgerelax1
This Edge Relax SOP, moves points around so the edges between them match those specified by the second input. Without this, areas with bunched up edges in the target mesh compared to the source mesh will cause the transferred muscles or bones to be bunched together accordingly.
measurethickness1, peak1
These nodes push the target skin points in slightly, based on the thickness of the mesh. This ensures a bit more space between Broot’s muscles and skin compared to Otto’s.
transfer_boneCapture_and_group
Transfers the bone capture attributes from the source character’s proxy skin to the target character’s render skin. This render skin’s topology does not need to match the source character. The tissue group is also transferred. This is used in the Test Geometry: Otto Muscle and Tissue Simulation Recipe to specify which region of the skin to create the tissue from. If you choose not to use the rig retargeting workflow, make sure you still transfer the tissue group onto your target character.
Note
Broot’s render skin mesh is relatively low resolution, so the subdivide_broot Subdivide SOP is added after this step. For other target characters with higher resolution render meshes, you can delete this node.
rig_transfer_and_rebuild
Creates an optional APEX rig for the target character from Otto’s APEX rig. See Rig Transfer for more information.
retarget_animation
Uses Biped Setup SOP and
Biped Retarget SOP to retarget the animation from the source character to the target character. See Animation Retarget for more information.
Rig Transfer ¶
This section covers the contents of the rig_transfer_and_rebuild subnet. The subnet transfers Otto’s APEX rig to the target character. This step is not required if your target character already has a rig or animation. However, it can be useful for building and testing a CFX setup before the character’s final rig and animation are complete. It also helps validate the output of the bone and muscle transfer, so you can iterate on the results early if necessary.
Note
This part of the recipe assumes the source rig is Otto or a rig based on Otto’s rig. If you use a different source character, review the rig-specific sections before relying on this network.
Start with the source character’s APEX rig, replace the relevant geometry inside it, then rebuild the rig.
Rig Skeleton Transfer ¶
The rig skeleton needs to be transferred from the source character to the target character.
-
Use a
Muscle Transfer SOP for the first pass. This only operates on points contained within the skin, so it excludes the root joint and eye joints. The root joint remains at the origin. Transfer the eye joints using a
Point Deform SOP.
-
Smooth the points on the neck. This may not be necessary, depending on the target character’s pose.
-
Correct the remaining joints with the
joint_position_setupsubnet. At this stage, all joints in the core hierarchy of the rig skeleton are in a good position, but the remaining joints, such as twist joints, are no longer aligned properly with the rig skeleton. Thejoint_position_setupsubnet corrects this on the left side of the skeleton. The default option also aligns the knee and elbow joints with the plane of limb motion to ensure accurate bending. If your character has notably bent limbs in its rest pose, turn on the Correct for Bent Limbs option on the subnet. If the bend is subtle, leave this option at its default. -
Mirror the joint corrections to the right side.
-
Invoke the joint orientations from the incoming source rig with an
Orient Joints SOP.
Tip
To visualize the joint orientations, you can connect a
Visualize Rig SOP to the
invoke_joint_orientationsnode. -
Store the rest transform for the new rig skeleton with a rig stash pose, then pack the new rig skeleton into the rig.
Ray Geometry Transfer ¶
-
Transfer the ray geo.
-
The Otto rig contains hidden geometry the scapulas and patellas use as a target ray surface to constrain to. This is referred to here as ray geo. In the incoming rig, these points are at the origin in joint local space. The recipe replaces the ray geometry with the original world-space positions of those points for two reasons:
-
This allows the ray geometry to be transferred to the target character.
-
The rig script requires the ray mesh to be in world space.
-
-
The transferred ray geometry is moved to joint-local space once the rig script is run.
-
Because the ray geometry is read from an Otto file, this step is specific to using Otto as the source character.
-
-
Unhide the world-space ray geometry, use a Muscle Transfer SOP to transfer to the target character, use a Delta Mush SOP to smooth it slightly, then hide it and pack it back into the rig.
Geometry Replacement ¶
At this stage, the recipe replaces the skin geometry in the rig with the target character’s skin geometry. This must include bone capture attributes, which are transferred in the transfer_boneCapture_and_group subnet.
The anatomical bones in the rig are then replaced with the bones from the bone transfer. If the goal is only to transfer the rig and the character will not be used for muscle simulation, this step is optional.
Note
Because the bone transfer can take a while to cook, you may want to cache the result with a File Cache SOP before connecting it to the rig_transfer_and_rebuild subnet.
Before the rig script runs, the existing Base.rig and Base.invert are deleted because the script creates these from scratch.
Apply Rig Script ¶
Rebuilding the rig requires Otto’s original rigscript.graph, instead of the precompiled rig output by the Test Geometry: Otto SOP. This is read with a File SOP and an
opdef: path to the Otto rig inside the HDA definition. For a different source character, this node must be replaced with the character’s uncompiled APEX rig.
An APEX AutoRig Component SOP applies Otto’s
rigscript.graph to Broot’s Base.shp and Base.skel, procedurally generating the evaluable APEX character rig (Base.rig) along with its companion inverse graph (Base.invert).
The final step in the rig rebuild is to add the Main Manager control to the rig which is displayed as a gear shape. This is duplicated from Otto’s rig setup. Clicking the gear brings up many useful options, including buttons to switch between the skin display and the bone display. This control gets repositioned based on the bounding box height of the target character, but you can position it wherever you want with the Offset parameter in the reposition_gear_control node.
The final step in the rig rebuild adds the Main Manager control to the rig, which is displayed as a gear shape. This is duplicated from Otto’s rig setup. Clicking the gear opens useful options, including buttons to switch between the skin display and bone display. The control is repositioned based on the bounding box height of the target character, but you can adjust its position with the Offset parameter in the reposition_gear_control node.
Animation Retarget ¶
The retarget_animation subnet in this recipe shows how to retarget Otto’s default animation to the target character. If you have an animated skeleton from a different biped, such as mocap data, you can connect it to the second input of the subnet instead. The animation source does not need to match the source character used in the rest of the transfer recipe. However, the source and target characters must both be bipeds for this optional part of the recipe.
This subnet outputs an APEX Scene, which requires a character name for the input target character. You can set this in the Character Name parameter field on the subnet.
Inside the subnet, both the target and source characters use a Biped Setup SOP. For
biped_setup_otto, the settings are left at their defaults. For biped_setup_target, the Neck and Spine Stretch values in the T-Pose → Stretch tab were adjusted to work better for Broot. For your own character, you may want to reset these to their defaults and adjust them as needed.
The retarget_animation subnet in this recipe shows how to retarget Otto’s default animation to the target character. If you have an animated skeleton from a different biped, such as mocap data, you can connect it to the second input of the subnet instead. The animation source does not need to match the source character used in the rest of the transfer recipe. However, the source and target characters must both be bipeds for this optional part of the recipe.
The Biped Retarget SOP then transfers the animation from the source skeleton to the target skeleton. Here the Head and Spine FBIK Weights are adjusted for Broot, and might need to be reset or changed for a different target character.
The Smooth Motion SOP is optional, though it can be useful for removing unwanted jitters from the resulting animation.
A Skeleton Blend SOP ensures the animation starts in the target character’s rest pose. Even if the source animation starts in a rest pose, retargeting can introduce slight offsets from the target rest pose. For CFX workflows, it’s important to restore the target rest pose. The blend uses an expression to blend into the animation over five frames starting from
$FSTART. You can change the duration or hard code the start frame depending on your needs.
Note
If your animation is not at the origin, you may want to transform your rest pose to match the animation starting location before the blend_from_tpose. You can do this with a Time Shift SOP to the first frame of the retargeted animation, connected to the second input of an
Extract Transform SOP, with the target rest skeleton as the first input. Next, connect your rest skeleton to a
Copy to Points SOP, with the Extract Transform as the second input. Finally, connect this to the first input of the
blend_from_tpose node.
If you prefer to skip the APEX rig rebuild step, you can connect this animated skeleton to the third input of a Bone Deform SOP to deform the skin or anatomical bones. To make full use of the APEX rig, connect the retargeted skeleton animation to the second input of an
APEX Animation from Skeleton SOP, with the APEX scene containing the target APEX character rig as the first input. This applies the constraints and correctives set up in the APEX rig, and lets you make any necessary adjustments to the animation afterward with an
APEX Scene Animate SOP.
Note
For the Scapula and Patella correctives to be applied, set the Controls parameter in the APEX Scene Animate SOP node to %callback(TransformObject) %callback(AbstractControl) -*_patella -*_scapula*.
Learning and using this example ¶
| To... | Do this |
|---|---|
|
Insert your proxy target skin mesh |
|
|
Use your own source geometry |
|
|
Match your source mesh size to the target mesh |
|
|
Visualize unmodified target mesh while using Muscle Transfer |
Tip This allows you to get a more accurate sense of the final position of the transferred bones or muscles, relative to the original skin, instead of the edgerelaxed, deflated, peaked in, or otherwise modified skin. |
|
Connecting the transferred muscles to a muscle simulation recipe. |
|
|
Creating rig skeletons to improve the result of the Bone Transfer. |
Tip If the transferred bones are not straight enough, follow the steps above but skip steps 7-9 to help straighten them. |