Project

General

Profile

Create pattern presets

What is the HowTo about?

In this HowTo page we are going to explain how to create color and pattern presets for a cloth piece (a pirate-ish head handkerchief). After creating a Child Object for the handkerchief, we are going to choose between several blending effects and masks.

What assets are needed?

All the assets from the basic customizable character HowTo.

A new Skeletal Mesh for the Handkerchief with the same Skeleton as the Parent mesh.

All the main textures for the Handkerchief.

Mask textures with different patterns.

The object of this example can be found as "Bandit_ClothPatterns" in MutableExamples/Bandit/CustomObjects/HowToExamples

Steps

1 - Create a Group node in the Parent Object. Name it and choose a Group Type. (In our case, “Handkerchief” and ‘toggle’).


2 - As the final customization will require a big node structure, create a new Customizable Object in the Content Browser. We named this new object “Bandit_Handkerchief_Patterns”.

The object of this example can be found as "Bandit_Hankerchief_Patterns" in MutableExamples/Bandit/CustomObjects/HowToExamples/ChildObjects

3 - Open the object and select the Reference Skeletal Mesh (the same as the parent).


4 - Name the Base Object node and in its properties tab, attach it to the Parent Object’s group (Bandit_ClothPatterns, Handkerchief).


5 - As we will use the same Material as the Parent, create an Extend Material node and select the Parent Material. Create a Skeletal Mesh node with the imported mesh for the handkerchief and connect a Mesh Layout (with its proper blocks) to itImport and connect any specific texture for the handkerchief. In our case, a roughness and a normal map.


6 - Create a Texture Layer node and connect it to the Color parameter in the Material node. This node will be the base for the color and pattern customization.


7 - Import and connect a base Color texture and a Mask texture (if needed) to the Texture Layer node. All the blending operations will affect this base color texture through the masked parts. Set a blending effect in the Texture Layer.


8 - Create a Texture Switch node and connect it to the Layer 0 in the Texture Layer. This will allow us to create several options to blend to the base color texture. Create an Enum Parameter node and connect to the Switch Parameter connection in the Texture Switch node. Name this Enum Parameter.


For each new option we want to create, add an element inside the Texture Switch properties tab and a new Value in the Enum Parameter. Each new Enum Value will have its own name that will appear in the Preview Inst. Properties tab.


9 - First option: single custom color. Add an element to the Texture Switch and an Enum Value called “Single Color”. Create a Sample Texture connected to a Float Parameter and a color bar Texture, all this connected to the new element in the Texture Switch.


10 - Second option: flowers pattern. Add an element to the Texture Switch and an Enum Value called “Flowers”. Create a Texture Layer node and connect it to the new element in the Texture Switch. In this Texture Layer patterns and colors will be blended to the base color texture (we’ll use the same texture used in the previous Texture Layer).

Connect the base color Texture in the Base connection in the Texture Layer. Add a couple of layers in the node and select their blending effect. As (if selected) the result from this Texture Layer will be applied in the main Texture Layer as the set blending effect, Modulate should work.

Create and import a pattern Mask and its inverted. For each layer, connect a pattern Mask and a Sample Texture with a Float Parameter and a Color Bar. This makes the two parts of the pattern color customizable.

  


11 - Third option: lines pattern. This is basically the same as the previous step but changing the pattern Masks. So, add an element to the Texture Switch and an Enum Value called “Lines”, and then create a node structure following the steps in 10.

There are some Texture nodes that can be used for several connections. For example, some color bars or the Base Color Texture for the handkerchief.


12 - Save and compile.

Result

There is now the Handkerchief object toggleable in the Preview Inst. Properties and, when selected, a dropdown menu with the options set with the Texture Switch and the Enum Parameter.