Components

This page introduces the components provided by the Deform Plugin. These components are the means in which the user sets up the simulations and communicates with the underlying physics engine.

Deform Manager

The Deform Manager is an AActor which can be found under DeformPlugin C++ Classes / DeformPlugin / Public.

The Deform Manager component works as a link between the Unreal Engine and the Deform Dynamics physics engine. In the Deform Manager, the user can set the global properties of the simulation. Fundamentally, the manager retrieves information about the scene in Unreal, and sends it to the physics engine. The physics engine then sends the updated information back to the manager, which delegates it out to the objects which have been affected by the simulation.

Please note that there should only be one Deform Manager per scene.


The Deform Manager contains the following parameters:

The Deform Manager contains the following public function,s which are also blueprint callable. These can be used to implement your own means of interaction with the cloth:

Deform Body

The Deform Body Component is a USceneComponent which can be added to an AStaticMeshActor by pressing Add Component on the actor.

The Deform Body Component is used to define objects that should be simulated, such as cloths. All objects which have a Deform Body attached, will send the mesh data to the simulation. The Deform Body Component can only be added to an AStaticMeshActor.


The Deform Body contains the following parameters:

Deform Mapping

The Deform Mapping Component is a USceneComponent which can be added to an AStaticMeshActor by pressing Add Component on the actor.

The Deform Mapping component can be used to map a mesh to a simulated object. This creates the ability to have separate render and physics meshes. The Deform Mapping Component can only be added to an AStaticMeshActor.


The Deform Mapping Component contains the following parameters:

Deform Mesh Collider

The Deform Mesh Collider Component is a USceneComponent which can be added to an ASkeletalMeshActor or AStaticMeshActor by pressing Add Component on the actor.

The Deform Collider Mesh component can be used to simulate collisions against animated characters, and static meshes.


To achieve the best possible results, the mesh should adhere to the following criteria:

  1. The triangles of the mesh should have approximately the same size.
  2. The mesh should not contain more than 6000-8000 vertices.
  3. The mesh should be closed and convex.
  4. It is very important that the vertex order is correct (CCW).
  5. The mesh cannot be too thin. The mesh has to have some volume.

If you enable the Remesh option, the engine will remesh the mesh you provide, with a vertex count that matches the number you specify in Num Remeshed Vertices. The remeshing feature will help you to fulfill criteria 1 and 2. This means that you can have an original mesh of much higher resolution.

Example: A dress on a moving character. The Deform Collider Mesh Component has been added to an ASkeletalMeshActor. The following parameters were used: Kinetic Friction: 0.4, Static Friction: 0.8, Bias: 0.0075, Should Remesh: enabled, Num Remeshed Vertices: 6000

Deform Serializer

The Deform Serializer Component is a UActorComponent which can be added to any actor. For example, it can be added to the Deform Manager.

When a scene is serialized, all the Deform Bodies are saved to the file in their current configuration. These files can then be loaded at a later stage. All rest values are intact, meaning that the simulation will start in the exact same state as when the file was saved. This is useful if you have a garment that is not perfectly aligned with a character. After the first simulation, you can serialize the garment in rest position, and start the simulation next time with a perfectly aligned mesh.

The serializer will produce two files: file_name.def and file_name.def.unreal. Both need to be present in the same folder for the loading to work.


The Deform Exporter component contains the following functionality:

Deform Skinning

The Deform Skinning Component is a USceneComponent which can be added to any AStaticMeshActor containing a Deform Body Component.

This component can be added to an actor containing a Deform Body Component in order to skin the body or parts of it to a Deform Mesh Collider. The vertices of the Deform Body will then be mapped to the closest point on the mesh, and follow it's movements. This can be used to get a glue effect on parts of the cloth which should not slide too much, such as the end of sleeves or a dress in the waist.


The Deform Skinning component contains the following functionality:

Deform Wind

The Deform Skinning Component is an AActor which can be found under DeformPlugin C++ Classes / DeformPlugin / Public, or by searching in the Place mode window.

This component can be added to the scene, and will help with setting the correct wind. The component is drawn with an arrow in the forward direction. In order to change the wind direction, you change the rotation of the AActor. You can also set the strength of the wind inside the wind component. Please note that currently, the wind is applied globally. In the future, features such as falloff and turbulence will be implemented.

The Deform Skinning component contains the following functionality:

Orbital Pawn

This is a pawn which provides some basic camera controls and means of interaction with the cloth. To use the OrbitalPawn, you have to set the Auto Posses Player parameter to be the player you want to should posses the pawn, and the Manager parameter to be the Deform Manager in the scene.

If you want to implement your own way of interacting with the cloth, please see the PickParticle, DragParticle and ReleaseParticle functions in the Deform Manager. You can look at the source code of OrbitalPawn to help you get started using these functions.

Editors

Here we list custom editors that can be used from the plugin.

Vertex paint editor

The vertex paint editor can be used in order to paint vertex specific coefficients on the Deform Bodies. The vertex paint editor can be found in the Modes tabs. To be able to paint, you need to select an object which is paintable. When the vertex paint editor is active, use your mouse cursor and hold left-CTRL to paint. This input method is temporary, and will be improved in a future update.



The different data which you can paint is the following:

The vertex paint editor contains the following functionalities:



Example of when friction is painted using the vertex paint editor