== Overview
(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
Shirt
== 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/)
== Steps
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.
{F86274}
> 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.
{F86276}
---
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”.
{F86278}
> 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.
{F86280}
---
5) In the Object Name sub-tab of the Node Properties tab, write the first piece of cloth’s name.
{F86282}
> 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.
{F86284}
---
7) In the Material sub-tab of the Node Properties tab, set the shirt’s material.
{F86286}
> In this case, the Material is “RemoveUnseen_Shirt_M
---
8) Create a Skeletal Mesh node and apply the shirt’s mesh on it.
{F86288}
> 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.
{F86290}
---
10) In the Node Properties tab, select the name of this Customizable Object asset.
{F86292}
> 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.
{F86294}
> 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.
{F86296}
> 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.
{F86298}
---
12) Check that the Source Graph looks similar to the image below.
{F86300}
---
13) Compile. In the Preview Instance Properties tab, a toggle button should appear with the child asset’s name as the title.
{F86302}
> 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.
{F86304}
(WARNING) Change the view mode button on the Preview Instance Viewport tab to change to “Wireframe” when required.
{F86306}
= Remove the unseen mesh
Trousers
== Assets required
* One material asset of a pair of trousers without parameters
* One skeletal mesh of the preview pair of trousers
* One skeletal mesh of the character’s body removing part
== Steps
(WARNING) Start this second example where the previous one finishes.
1) In this second example, a second child asset is to be created. From the “Objects” connection of the Group node create a new Child Object node.
{F86313}
---
2) In the Node Properties tab, with the Child Object node selected, write a name in the Object name sub-tab. Leave by default the other options.
{F86315}
> In this example, the child asset is a pair of trousers, so the Object’s Name is “Trousers”.
---
3) This child asset uses its own material too, so a Material node is required. From the “LOD 0” connection of the Child Object node create a Material node.
{F86317}
---
4) In the Material sub-tab of the Node Properties tab, set the trousers’ own material. This material doesn’t have any parameters but encloses its own textures.
{F86319}
> In this case, the material selected is “RemoveUnseen_Trousers_M”.
---
5) Create a Skeletal Mesh node and, in its Node Properties tab, assign the trousers’ mesh.
{F86321}
> In this example, the skeletal mesh chosen is “RemoveUnseen_Trousers”.
Afterward, link the “meshes” connections of the Skeletal mesh node and the Material One between them.
{F86323}
---
6) The second child asset is already created. What is required now is a different way of removing the unseen mesh. From the “LOD 0” connection of the Child Object node, create a Remove Mesh node.
{F86325}
---
7) In the Node Properties tab, select the parent’s material (the character’s body one) which is the one from which a part is to be removed.
{F86327}
8) Create a Skeletal Mesh node and, in its Node Properties tab, select the mesh of the part of the character’s body to remove. This mesh should be an exact copy of the character’s body but well delimited to fit the covered body when the trousers are enabled.
{F86329}
Finally link the “Unnamed Material Mesh” connection of the Skeletal Mesh to the “Remove Mesh” one of the Remove Mesh node.
{F86331}
---
9) Check that the Source Graph looks similar to the image below. The first two child assets are created with two different ways of removing the unseen body’s mesh.
{F86333}
(WARNING) Remember that creating Comments to frame or enclose each example (child asset) can help organize better the nodes.
---
10) Compile and check that the new toggle button works well on the character. Verify that the mesh as well.
{F86335}
FALTA PROVA MESH