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:
-
Computation Type: The computation type which should be used. The types are: CPU, CPU_MULTI and GPU_CUDA. Using the CPU is generally slower than using the GPU. However, you need a CUDA capable graphics card to use this option, otherwise CPU_MULTI will be automatically used by the plugin.
-
Solver iterations: The number of solver iterations that should be run each frame. With a higher value, the simulation is more accurate, at the expense of performance.
-
Timesteps per frame: The number of timesteps that should be made during one frame. This value can be raised to increase the quality of moving characters, and self collisions, at the expense of performance.
-
Timestep: The amount of time that should be simulated in one timestep.
-
Laplacian Damping Iterations: How many times laplacian damping is applied for each time step. It affects performance negatively.
-
Laplacian Damping Coefficient: The laplacian damping coefficient. It dampens the velocity, giving a "heavier" dynamic behaviour to the cloth.
-
Gravity: The global gravity of the scene.
-
Wind: The global wind of the scene.
-
Air friction: The amount of damping exerted by the air.
-
Self collisions: Whether the cloth should be able to collide with itself and other clothes or not.
-
Surface sampling: Enabling surface sampling results in better self-collisions when the triangles of the simulated DeformBody objects are of varying size.
-
Ignore intersecting particles: If this option is enabled, particles which are overlapping at initialization are discarded from the self-collision mechanism. This can be used to remove vibrations in the self collisions, when the triangles are of varying size but you don't want to use Surface sampling.
-
Kinetic friction: The amount of kinetic friction used for self-collisions.
-
Static friction: The amount of static friction used for self-collisions.
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:
-
PickParticle: A function that finds picks a particle given a ray.
FVector start - the start point of the ray
FVector end - the end point of the ray -
DragParticle: A function that drags the particle selected by the PickParticle function, according to the input ray.
FVector start - the start point of the ray
FVector end - the end point of the ray -
ReleaseParticle: A function that releases the particle selected by the PickParticle function
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:
-
Object Mass: The total mass of the object in grams. The mass affects the behavior of friction and wind forces.
-
Distance Stiffness: The distance stiffness specifies how strict the distance constraints are enforced. With a low distance stiffness value, the cloth appears stretchier.
-
Bending Stiffness: Bending is an essential property to simulate, when aiming to create believable cloth simulations. This constraint governs the angle between two particles in relation to two other particles.
-
Visible: Whether or not the Deform Body should be rendered. It can be useful to not render the cloth when using the Deform Mapping Component.
-
Pinned Texture: A texture specifying which vertices should be pinned. Black (RGB: 0, 0, 0) represents a pinned vertex, all other colors are not considered.
-
Kinetic Friction Texture: A texture specifying the kinetic friction coefficient of each vertex. Black (RGB: 0, 0, 0) represents 1.0 and white (RGB: 255, 255, 255) represents 0.0. Colors in-between can also be used, for example gray (RGB: 128, 128, 128) represents 0.5.
-
Kinetic Friction Texture Scale: This value can be used to scale up the values read in the Kinetic Friction Texture.
-
Static Friction Texture: A texture specifying the static friction coefficient of each vertex. Black (RGB: 0, 0, 0) represents 1.0 and white (RGB: 255, 255, 255) represents 0.0. Colors in-between can also be used, for example gray (RGB: 128, 128, 128) represents 0.5.
-
Static Friction Texture Scale: This value can be used to scale up the values read in the Static Friction Texture.
-
Collision Mask Self Texture: A texture specifying the collision masks of the self collisions. Vertices with a white collision mask will collide with all other masks. Vertices with other colors will only collide with vertices with the same color and white. These exact colors can be used: White (RGB: 255, 255, 255), Red (RGB: 255, 0, 0), Blue (RGB: 0, 0, 255), Green (RGB: 0, 0, 255), Yellow (RGB: 255, 255, 0).
-
Collision Mask External Texture: A texture specifying the collision masks against the mesh collider. This must be used together with the collision mask of the Mesh Collider to have an effect. Vertices with a white collision mask will collide with all other masks. Vertices with other colors will only collide with vertices with the same color and white. These exact colors can be used: White (RGB: 255, 255, 255), Red (RGB: 255, 0, 0), Blue (RGB: 0, 0, 255), Green (RGB: 0, 0, 255), Yellow (RGB: 255, 255, 0).
-
Base Mesh: This UStaticMesh is used to specify the rest values of the deformable body. The physics engine will try to deform the body into this configuration. If this parameter is empty, the Deform Plugin will use the actors current mesh configuration as base. This can be useful when you want to simulate a cloth from a deformed starting pose, but still want the dynamic behavior of the undeformed mesh. Please note that the Base Mesh must contain the same amount of vertices as the AStaticMeshActor that the Deform Body Component is attached to.
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:
- Map To: The Deform Body this object should be mapped to.
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:
- The triangles of the mesh should have approximately the same size.
- The mesh should not contain more than 6000-8000 vertices.
- The mesh should be closed and convex.
- It is very important that the vertex order is correct (CCW).
- 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.
-
Kinetic Friction: The kinetic friction of the collider [0-1]. This is the friction between moving surfaces.
-
Static Friction: The static friction of the collider [0-10]. This is the friction between non-moving surfaces.
-
Bias: How much bigger the collision mesh should be compared to the rendered mesh. This is used to prevent Z-fighting.
-
Should Remesh: Whether or not an optimized version of the mesh should be used internally in the physics engine. This is especially helpful if a mesh of very varying triangle size is used or if the mesh collider contains many vertices (> 20 000 vertices).
-
Num Remeshed Vertices: The number of vertices the remeshing should aim to use.
-
Collision Mask Texture: A texture specifying the collision masks of the mesh collider. This must be used together with the external collision mask of the Deform Body to have an effect. Vertices with a white collision mask will collide with all other masks. Vertices with other colors will only collide with vertices with the same color and white. These exact colors can be used: White (RGB: 255, 255, 255), Red (RGB: 255, 0, 0), Blue (RGB: 0, 0, 255), Green (RGB: 0, 0, 255), Yellow (RGB: 255, 255, 0).
-
Consider Morph Targets: When this option is active, the vertices of the mesh collider will be considered instead of the bones. This means that morph targets will affect the mesh collider, at the cost of performance. Note: This parameter will only have an effect if the mesh collider is attached to a Skeletal Mesh.The Consider Morph Targets functionality is currently only available in the 4.21 and 4.24 versions of the plugin. In the 4.25 version, this option is always enabled, due to Epic changing the API of the Unreal Engine. This will hopefully be solved soon.

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:
-
Load: Loads the serialized file specified.
-
Save: Saves a serialized file at the location specified.
-
Browse: Starts a browser to help to specify the path where the serialized files should be saved.
-
Serialized Path: The path and filename where the serialized files should be saved. Please note the path must end with a .def postfix. This has to be entered by the user. This will be fixed in future updates.
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:
-
Mesh Collider Component Name: The Deform Mesh Collider that the specified vertices should be skinned to. The scene will be searched for a mesh collider component with the name specified. This name must be unique.
-
Full Skinning Strength: The strength of the full skinning. This can be changed in run-time.
-
Use Full Skinning: Whether or not to use full skinning. If full skinning is used, every particle of the deform body will be skinned to the specified Mesh Collider, with the specified skinning strength. This can be changed in run-time.
-
Skinning Texture: A texture specifying the skinning strength of each vertex. Black (RGB: 0, 0, 0) represents 100% skinning and white (RGB: 255, 255, 255) represents no skinning. Colors in-between can also be used, for example gray (RGB: 128, 128, 128) represents a 50% blend between skinning and simulation.
-
Skinning Texture Strength: This value can be used to scale up the values read in the Skinning Texture.
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:
-
Direction: The direction is determined by the rotation of the actor. The rotation can be changed from within blueprints by using the AddActorLocalRotation node.
-
Strength: The strength of the wind. This can be found inside the Deform Wind Component in the actor.
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:
-
Pinning: The pinned vertices will not be affected by the simulation. Paintable object: Deform Body.
-
Kinetic Friction: The kinetic friction coefficient of a vertex. Paintable object: Deform Body.
-
Static Friction: The static friction coefficient of a vertex. Paintable object: Deform Body.
-
Skinning: The vertices which should be skinned, and with what strength. Paintable object: Deform Body containing a Deform Skinning Component.
-
Collision mask self collider: Decides which vertices can collide with each other. Vertices with a white collision mask (default) will collide with all other masks. Vertices with other colors will only collide with vertices with the same color or white. Paintable object: Deform Body.
-
Collision mask external: Decides which vertices can collide with the mesh collider. Vertices with a white collision mask (default) will collide with masks of all other colors. Vertices with other colors will only collide with vertices with the same color or white. Paintable object: Deform Body.
-
Collision mask mesh collider: Decides which vertices on the mesh collider that will collide with the cloth. Vertices with a white collision mask (default) will collide with masks of all other colors. Vertices with other colors will not be colliding with vertices of the cloth. Paintable object: Deform Mesh Collider.
The vertex paint editor contains the following functionalities:
-
Radius: Sets the size of the vertex paintbrush radius.
-
Erase: Makes the brush remove already painted vertices.
-
Fill: Applies the current settings to all vertices of the Deform Body.
-
Erase All: Removes all painted vertices on the current type.

Example of when friction is painted using the vertex paint editor