(WARNING) We recommend visiting the [[ https://work.anticto.com/w/mutable/unreal-engine-4/user-documentation/basic-concepts/ | Basic Concepts ]] page before start creating any Customizable Object
(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"
= Using a Clipping Volume
== Assets required
* One material asset or material instance of a base character without parameters
* One skeletal mesh of the character with one material slot only
* One material asset of a shirt without parameters
* One skeletal mesh of the shirt with one material slot only
* One skeletal mesh of a clipping volume that overlays the shirt’s 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/RemoveUnseen//
(WARNING) Check the following page to read more about **Child Objects** and object's hierarchies. https://work.anticto.com/w/mutable/unreal-engine-4/user-documentation/organize-customizable-objects-child-objects/)
1) The first step is to create a basic [[ URL | Customizable Object]] asset with the **Base Object**, a **Material** node, and a **Skeletal Mesh**. Link all the connections of the same color.
> In this example, the Customizable Object asset is named "RemoveUnseen", the Reference Skeletal is "RemoveUnseen_BaseBody", the Material is called “RemoveUnseen_M” and the Skeletal Mesh is the same as the Reference Skeletal’s one.
2) In this first example, a shirt has to be applied on the base character removing the covered part of the character’s body mesh. Moreover, to enable or disable this piece of cloth and the ones referred to further on in the next examples, a Group is to be created.
Create a Group node from the “Children” connection of the Base Object.
3) In the Node Properties, with the Group Node selected, write a name in the Group name sub-tab. The Group Type can be left by default in “Toggle”.
> In this case, the group’s name is “Clothes” so it is created to enclose multiple pieces later.
4) Create a Child Object node from the “Objects” connection of the Group node. This node permits creating a child asset for this first example.
5) In the Object Name sub-tab of the Node Properties tab, write the first piece of cloth’s name.
> In this example, the Object Name is “Shirt”.
6) The child asset, the shirt, has its own material with its related textures included. For this reason, a new material has to come into play. From the “LOD 0” connection of the Children Object drag and drop to create a Material node.
7) In the Material sub-tab of the Node Properties tab, set the shirt’s material.
> In this case, the Material is “RemoveUnseen_Shirt_M
8) Create a Skeletal Mesh node and apply the shirt’s mesh on it.
> In this example, the Skeletal Mesh is “RemoveUnseen_Shirt”.
Link its “Unnamed Material Mesh” connection to the “Mesh”’ Material node’s one. With this connection, the child asset is already created.
9) Once the child asset is created, the objective of this exercise is to remove the mesh of the character’s body hidden under the shirt using a clip mesh. Create a Clip Mesh With Mesh node from the “LOD 0” connection of the Child Object node.
10) In the Node Properties tab, select the name of this Customizable Object asset.
> In this case, the Customizable Object is “RemoveUnseen”.
After that, unfold the drop-down menu placed under the previous one and select the material related to the mesh from which a part is to be removed.
> In this example, the material is “RemoveUnseen_Body_M”.
11) Create a Skeletal Mesh node and, in its Node properties tab, set the mesh of the clipping volume. This mesh should overlay the shirt’s mesh volume and contain it inside its own.
> In this case, the skeletal mesh selected is “RemoveUnseen_Shirt_Clipping”.
Link the “Unnamed Material Mesh” connection of the Skeletal Mesh node to the Clip Mesh With Mesh node’s “Clip Mesh” connection.
12) Check that the Source Graph looks similar to the image below.
13) Compile. In the Preview Instance Properties tab, a toggle button should appear with the child asset’s name as the title.
> In this example, the button’s name is “Shirt”.
Enable the “Shirt” button. Now, verify that not only the shirt is applied to the character but also that underneath its mesh the body has been removed.
(WARNING) Change the view mode button on the Preview Instance Viewport tab to change to “Wireframe” when required.