== Overview
This tutorial explains how to create a Customizable Object with a feature that allows for changing and choosing a character's skin tone. Once the tutorial's steps are followed and compiled, a selector slider, with a color skin bar on top, will be displayed and the user will be able to select a skin tone through it and to see immediately the variation applied to the character.
= Change the skin tone of a character
(NOTE) The resulting Customizable Object of this example can be found in the [[ https://work.anticto.com/w/mutable/unreal-engine-4/examples/#village-demo | Village Demo ]] in //Content/Examples/HowTo// named "SkinTone"
== Assets required
* One material asset or material instance with one color parameter (it may or may not have textures but only one slot converted to parameter)
* One skeletal mesh with only one material slot
* One texture asset of the base skin texture of the character
* One mask texture of the character's skin
* One texture asset of a "skin color bar"
(NOTE) The assets used in this example can be found in the [[ https://work.anticto.com/w/mutable/unreal-engine-4/examples/#village-demo | Village Demo ]] in //Content/HowTo/SkinTone//
== Steps
1) The first step is to create a [[ URL | Customizable Object]] asset. Open it and name the [[ https://work.anticto.com/w/mutable/unreal-engine-4/user-documentation/nodes/base-object/ | Base Object ]] node in the [[ URL | Graph Node Properties ]] and set a [[ URL | Reference Skeletal Mesh ]] in the [[ URL | Object Properties ]] tab.
Image Step 1
> The Customizable Object asset in the Unreal Engine Content Browser. In this example, the Customizable Object asset is named "SkinTone"
2) As the objective is to change the skin tone of the character, a node that can modify the texture parameters of the skeletal mesh's material and apply a "color bar" instead of a simple texture is needed. A Texture Layer node allows modifying a base texture with blending options and masks. From the "Base Color" connection in the **Material** node, create a [[ https://work.anticto.com/w/mutable/unreal-engine-4/user-documentation/nodes/texture-layer/ |Texture Layer ]] node.
Image Step 2
3) With the Texture Layer node selected, in the Graph Node Properties tab, click the "+" button in the Layers sub-tab. This creates a layer that results in two new slots in the Texture Layer node.
Image Step 3A
> Each layer created in the **Texture Layer** node has two connections: the "Layer X" and the "Mask X" connections.
Still in the **Graph Node Properties**, click to unfold the tab of the new layer created. Choose the effect of blending among all the options displayed unfolding the Effect sub-tab. This effect will determine the visual interaction between the texture to be added to create the skin tones and the base layer.
Image Step 3B
> The Effect in this example is left by default as "Cotle Softlight".
4) Create a **Texture** node dragging and dropping from the "Base" connection of the **Texture Layer** node.
Image Step 4
5) With the new **Texture** node selected, choose a base texture for the character in the Graph Node Properties tab. This texture is the one on which the blending effect will be applied.
Image Step 5
> In this example, the "SkinTone_BaseTexture_D" texture is used.
6) Create another **Texture** node from the "Mask 0" connection of the **Texture Layer**. This texture is the mask related to the skin color of the character.
Image Step 6
7) In the Graph Node Properties, choose a black-and-white texture which masks in black the non-skin parts of the base texture, for example, the eyes, and leaves the rest in white.
Image Step 7
> In this example, for the "Mask 0" connection, the "SkinTone_SkinMask" texture is used.
8) In the "Layer 0" connection, a texture with color information is to be connected. This texture is the one to blenshould be a selected color of a "skin color bar" used mixed with the "Base" texture through an effect (set in Step 5) to get different skin tonesthe blending effect already selected. As the objective is to get a "color slider selector" to choose the skin color directly by clicking and previewing the resultTo start with, the most suitable node is the **Sample Texture** nodea node that takes samples from a color bar is the needed one. Create a [[ https://work.anticto.com/w/mutable/unreal-engine-4/user-documentation/nodes/sample-texture/ | Sample Texture ]] node. Connect it from theLink its "Color" connection to the "Layer 0" one of the **Texture Layer** node.
{F85465}Image Step 8
109) Create a **Texture** node from the "Texture" connection in the **Sample Texture** node.of the **Sample Texture** node. This texture should be the image from which the Sample Texture node takes each selected color.
Image Step 9
10) In the Graph Node Properties, and with this last Texture node selected, Choose aset the required "skin color bar" texture.
{F85467}.
Image Step 10
> In this example, the" SkinTone_ColorBar" texture is used.
11) Now, the only remaining node is the one that allows selecting a color value and create a slider. Click and drag from the "X ""X" connection inof the **Sample Texture** node to create a **Float Parameter** node. This node allows picking a horizontally-based value from the color bar texture.
{F85469}Image Step 11
12) Select the **Float Parameter** node and name it in the Graph Node Properties tab. This name is appearing as a title next to the "skin color bar" when compiling.
Change the Default Value in the *Graph Node Properties tab if preferred. It is to provide the color value chosen as the default one after compiling the first time.
Image Step 12A
Click the (**+**) icon in the "Description Image" to enable the option of showing an image in the slider selector.
{F85471}>In the example, the Parameter Name used is "Skin Tone" and the Default Value is changed to "0.0" to display the first color of the "skin color bar" as default.
>InClick the "+" icon of the Description Image to enable the example,option of showing an image in the slider selector. Name this new connection by clicking on the Parameter Name used is "Skin Tone"small sub-tab of this new "0" layer created and changing the default name.
Image Step 12B
>In this example, the Description Image is called "Skin Color Bar".
13) Back to the **Source Graph**, connect the "Description Image 0"Skin Color Bar" connection of the** Float Parameter** node to the "Image" one of the **Texture** node.
{F85473}Image Step 13
14) Before compiling, check that the **Source Graph** looks similar to the example below:
{F85475}Image Step 14
15) Compile. The result in the Preview Instance Properties tab should look similar to the image below.
Image Step 15A
15) Compile. The result should look similar to the image belowTry to move the "selector slider" and select a color. The "selector slider"It must work when choosing a color andimmediately be immediately appliedvisible on the character's skin.
{F85477}
> The resulting mesh in the [[ URL | Preview Instance Viewport ]] tab and the selector slider in the [[ URL | Preview Instance Properties ]].Image Step 15B
(WARNING) If the colors displayed on the character skin don't look similar to the one of the "skin color bar", try to change the blending effect in the **Texture Layer** node.