Automatic skinning transfer allows layered clothing and facial accessories to deform accurately along with the character model it's attached to without having to skin the accessory itself. Instead of the complex task of manually skinning models in 3D modeling software, you can use this feature to transfer or generate skinning data to the accessory. When using automatic skinning transfer, the Roblox engine creates and applies skinning at runtime.
No skinning of accessory geometry is required to use automatic skinning transfer. In fact, auto-skinned accessories work well with most characters they're attached to, even if those characters have a different number of joints, bones, or use a different kind of skinning, and the accessories move accurately with characters as they animate.
Skinning is still an important concept for character creation, and if you're creating custom characters, you may want to apply skinning data to the model to create a character with more natural looking poses and animations. For information on how to skin a mesh, see Skinning a Humanoid Model.
Enabling Automatic Skinning Transfer
To enable the automatic skinning transfer process, you must enable the AutoSkin property within the WrapLayer instance of the layered Accessory you want to automatically skin, then set it to one of the following values:
- Disabled: Disables the automatic skinning transfer process. This is the default value.
- EnabledOverride: Enables the automatic skinning transfer process, and allows it to override any existing skinning information found on the accessory at run time.
- EnabledPreserve: Enables the automatic skinning transfer process, but doesn't allow it to override any existing skinning information found on the accessory at runtime. If there isn't any skinning to maintain, the automatic skinning transfer process automatically creates new skinning data.
When there isn't any skinning data on the accessory, or if you choose to override any existing skinning data associated with the accessory, the Roblox engine calculates skinning data from the character's geometry and cages, then the new skinning data and rig associated with the accessory drives the accessory's deformations and motions in sync with the source geometry itself.
While automatic skinning often works better than manual skinning, there are some best practices to reduce unexpected behavior with the accessory skinning. Like all modeling processes, constantly test your layered clothing and facial accessories on different avatar types to achieve the results you want.
Modifying Character Cages
You can modify character cages for the accessories to deform accurately to the expected character surfaces using the automatic skinning transfer. For example, auto-skinning may cause layered accessories to deform based on an incorrect body part because the transfer process is based on the closest distance between the accessory and its inner cage. In the following instance, a beard accessory was modeled using a blocky-type full-body cage. This causes the beard to deform incorrectly because parts of the beard are closer to the character cage's upper chest instead of the chin:
To prevent a layered accessory from using skinning data from an undesired area of the character's geometry, you can remove parts of the outer cage that the layered accessory shouldn't be skinned to. For example, the following image shows how the outer cage was modified so that it only includes the head geometry. With this improvement to the outer cage, when you automatically transfer skinning data, the beard and partial cage now correctly transfer skinning only from the head geometry.
It's important to note that you could also solve the previous example's deformation issue by using a different cage altogether. For example, if you use a more humanoid cage with more space between the chest and the chin, the beard is closest to the head instead of being near the chest or neck area, so the automatic skinning transfer wouldn't transfer skinning data from those regions.
By modifying different regions of the character's cage, you can ensure that your layered clothing and facial accessories deform in relation to the correct region of the body or head, such as modifying the character model's arms so dresses don't incorrectly attach to them while a character is running, or modifying pants that incorrectly map to feet. The following video demonstrates how a jacket's collar incorrectly moves with the head, as the layered clothing is deforming in the collar region, which is closest to the head portion of the cage. To resolve this, you can remove the head portion of the cage so that the jacket won't incorrectly deform in relation to the head at all. Instead, it will deform in relation to the shoulder region, which is much more appropriate for this article of clothing.
Different Accessory Types
Automatic skinning transfer may not work well for certain accessory types, such as eyelash, hat, and glasses-type accessories. For example, eyelash-type accessories might have issues due to the typical complexity of the character's geometry around the eye region, and hat or glasses-type accessories might introduce deformation in areas that should typically be rigid. In general, those types of accessories should remain rigid, and you shouldn't associate any skinning data with them.
For a summary of suggested WrapLayer.AutoSkin parameters for different accessory types, see the following table:
|Accessory Type||Suggested Parameter|
|Shirt||EnabledOverride or EnabledPreserve|
|Pants||EnabledOverride or EnabledPreserve|
|Shoes||EnabledOverride or EnabledPreserve|