-
Notifications
You must be signed in to change notification settings - Fork 14
Additional Cloth workflow tests
Make a model using your preferred DCC (maya, 3ds max, blender) with the following parts:
-
Cloth mesh
-
This is the cloth mesh that is going to be rendered and simulated.
-
(Optional) The vertices can have color, using DCC vertex painting tool assign values to the** red channel**:
- 0 means the vertex won't be affected by cloth simulation, it will be static.
- Any other value represent the invert mass of the vertex. For example a value of 0.3 in the red channel means the vertex has a mass value of 3.33 (from 1.0/0.3). The smaller (darker) the value the greater the mass.
-
- (Optional) Any other static mesh not related to cloth.
- Any other static meshes to be rendered with the cloth.
Export this file to LY using fbx.
- In LY editor, find the fbx file in Asset Browser
- Right click, Edit Settings
- Setup the mesh in the Mesh tab
-
Give the mesh a name
-
Make sure the cloth mesh has been selected in "Select Meshes"
-
(Optional) Select also any other static meshes if desired.
-
Add a Cloth Modifier
- Select the the cloth mesh from the drop-down list**.**
- Select the vertex color stream that includes the invert masses.
- If no vertex color stream is provided it will default the invert mass to 1.0 for all the vertices.
-
- Click the Update button
-
In LY editor, add a new entity to the world
- Add a Mesh Component and reference the mesh asset and material.
- Add a Cloth component
- Select one cloth mesh. The drop-down lists all the cloths inside the Mesh.
- Tweak cloth settings to control the motion of the cloth
In LY editor, enter play mode (Ctrl+G)
To enable debug visualisation of cloth, bring up console terminal and enter the command 'cloth_DebugDraw' with the level of debugging desired:
- 0: No cloth debug visualisation
- 1: Draw wireframe cloth mesh and particles, coloured by the inverse mass values.
- 2: In addition, draw the character cloth colliders.
Make a character model using your preferred DCC (maya, 3ds max, blender) with the following parts:
-
Body mesh (not related to cloth)
- Visual representation of the character, skinned to the skeleton, doesn't include cloth.
- Visual representation of the character, skinned to the skeleton, doesn't include cloth.
-
Cloth mesh
-
This is the cloth mesh that is going to be rendered and simulated.
-
It has to be skinned. The bones don't have to be exclusive for the cloth mesh. Since the cloth simulation is going to take over, it's recommended that the number of additional bones added just for cloth to be low.
-
The vertices can have color, using DCC vertex painting tool assign values to the** red channel**:
- 0 means the vertex won't be affected by cloth simulation, it will follow its bone's animation (anchor).
- Any other value represent the invert mass of the vertex. For example a value of 0.3 in the red channel means the vertex has a mass value of 3.33 (from 1.0/0.3). The smaller (darker) the value the greater the mass.
-
-
Skeleton
- Normal ordinary bones for the character and cloth.
- (Optional) Cloth mesh can have its own bones to drive it, or use any bones of the skeleton.
-
Animations
- Feel free to animate the entire skeleton, including cloth bones.
- Hand-authored cloth animations can blend with simulated cloth animations at runtime.
Export this file to LY using fbx.
-
In LY editor, find the fbx file in Asset Browser
-
Right click, Edit Settings
-
Setup the actor in the Actor tab
-
Give the actor a name
-
Make sure all character meshes are selected, included cloth mesh, in "Select base meshes".
-
Add a Cloth Modifier
- Select the the cloth mesh from the drop-down list**.**
- Select the vertex color stream that includes the invert masses.
-
-
Press Update button
- In LY editor, add a new entity to the world
-
Add an Actor component and reference the actor asset and material.
-
Add an Anim Graph component and reference the actor anim graph asset and motion set.
-
Add a Cloth component
- Select one cloth mesh. The drop-down lists all the cloths inside the Actor.
- Tweak cloth settings to control the motion of the cloth
- NOTE: When using Cloth component with Actors it shows the parameter 'Animation Blending' to blend between cloth simulation and skinning animation.
-
- In LY editor, open Animation Editor with the character's actor asset.
- Switch to Physics layout
- Select the bone of the skeleton you wish to add a cloth collider to.
- Right click on the bone to open cloth menu. You can add colliders (capsules or spheres) or you can copy them from Hit Detection, Ragdolls or Simulated Objects.
- The Cloth Colliders tab will show the list of cloth colliders for the selected bone.
- Adjust the dimensions, offset and rotation of cloth colliders.
In LY editor, enter play mode (Ctrl+G)
To enable debug visualisation of cloth, bring up console terminal and enter the command 'cloth_DebugDraw' with the level of debugging desired:
- 0: No cloth debug visualisation
- 1: Draw wireframe cloth mesh and particles, coloured by the inverse mass values.
- 2: In addition, draw the character cloth colliders.