This article explains how to create a Customizable Object with nodes that allow adding patterns on a mesh and applying colors based on the number of masks created. Two examples of a head’s handkerchief are created from less to more complexity. The first example features the choice of a combination of two colors for a handkerchief pattern using only a color selector slider linked to a secondary "color bar". However, the second example presents multiple choices of patterns and two "color bars" working independently one from another.
(WARNING) We recommend visiting the [[ URL | Basic Concepts ]] page before start creating any Customizable Object
= = Add a pattern with a preset combination of colors
In this example, a Texture Layer node is used to apply two pattern complementary masks linked to two different color bars but controlled through only one color selector slider. This slider displays only the main "color bar", so the user cannot choose two colors but a preset combination when choosing the main one. In this case, the color bars have a great range of color gradients.
(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 "ColorPatterns"
== Assets required
* One material asset or material instance of the character standard with two parameters (color and normal)
* One skeletal mesh of the character with the previous material applied (one material, two parameters)
* One skeletal mesh of a cloth asset
* One Color Base, one Normal and one Roughness (if wanted) textures of the cloth asset
* One general mask texture of the cloth area the patterns are to be applied
* One mask of the pattern (Mask A)
* One mask of the pattern inverted (Mask B)
* One color bar with gradient colors
* One secondary color bar with gradient colors (combined vertically with the previous one)
(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/ColorPatterns//
1) The first step is to create a basic [[ URL | Customizable Object]] asset with the Base Object, the Material, and the Skeletal Mesh. Connect all the parameters with the same name.
> In this example, the Customizable Object asset is named "Color Patterns", the Reference Skeletal is "ColorPatterns_mesh", the Material is called “ColorPatterns_M” and the Skeletal Mesh is the same as the Reference Skeletal’s one.
2) As the objective is to apply colored patterns to a cloth asset’s mesh, a Child Object is to be used to add this mesh to the character. Create a [[ URL | Child Object ]] node.
3) Select the Child Object node and name it in the Graph Node Properties tab.
> In this case, the Object Name is “Handkerchief”.
4) Create an Extend Material node dragging from the “LOD 0” connection of the Child Object node. This node allows using the same material as the parent’s one but connecting new textures to the slots if wanted.
5) In the Graph Node Properties tab, select the parent’s material in the Parent sub-tab.
> In this example, the material selected is “ColorPatterns_M”.
6) From the “Add Mesh” connection of the Extend Material node create a Skeletal Mesh node. In the Graph Node Properties tab, choose a cloth or fabric asset’s mesh.
> In this example, the Skeletal Mesh selected is “ColorPatterns_OnlyHandkerchief”.
7) Create a Texture node from the “Normal” connection of the Extend Material node.
8) In the Texture sub-tab of the Graph Node Properties tab, select the cloth asset’s normal map.
> In this example, the Texture selected is “ColorPatterns_Handkerchief_N”.
9) Add a [[ URL | Texture Layer ]] node from the “Color” connection of the Extend Material node. This new node permits to add multiple layers and masks on a base texture.
10) With the Texture Layer node selected, go to the Graph Node Properties tab and select the “+” button in the Layer sub-tab.
After creating a layer, two new slots appear in the Texture Layer node. The “Mask 0” connection is supposed to be connected to a pattern’s mask texture whereas the “Layer 0” one to a color bar.
Unfold the little sub-tab next to the “0” layer in the Graph Node Properties tab. Here, the blend effect is to be chosen from the drop-down menu in the Effect sub-tab. This effect is supposed to be applied to the “Base” connection’s texture using the color of the “Layer 0” one.
> In this example, the Effect chosen is “Cotle Hardlight”.
11) As the objective is to have two masked parts of a pattern filled with two different colors, another layer is needed in the Texture Layer node. Create another layer in the clicking the “+” button in the Graph Node Properties tab. Select the same blend effect if wanted.
12) The “Base” connection of the Texture Layer node has to be linked to a Base texture on which the blend effects of the “color bars” are to be applied. Drag and drop from the “Base” connection of the Texture Layer node and create a [[ URL | Texture ]] node.
13) Graph Node Properties tab, choose a base texture of the cloth’s asset.
> In this case, the “ColorPatterns_Handkerchief_D” is the selected one. It is a light-gray-color-based texture because of its neutrality when other colors are blended on it.
14) Click and drag from the “Mask 0” connection to create another Texture node. One texture masking a part of a pattern must be connected here.
15) In the Graph Node Properties, choose the mask preferred.
> In this example, the “ColorPatterns_Lines_MaskA” is the selected one.