Skip to content

UMjFlexcomp

Component representing a MuJoCo flexcomp deformable body.

Flexcomp generates a deformable soft body: ropes (dim=1), cloth (dim=2), or volumetric (dim=3). At spec registration, it expands into a flex element plus child bodies with slider joints for non-pinned vertices.

Attribute Value
Kind Class
UE Macro UCLASS
Inherits UMjComponent
Blueprint Spawnable ✅ Yes

Properties

Public Properties

Property Type Description
Pos FVector
Quat FQuat
group int32
dim int32
radius float
rigid bool
mass float
inertiabox float
file FString
material FString
rgba FLinearColor
flatskin bool
FlexcompType EMjFlexcompType
FlexcompDof EMjFlexcompDof
ConType int32
ConAffinity int32
ConDim int32
Priority int32
Margin float
Gap float
SelfCollide int32
bInternal bool
Friction TArray<float> Contact friction: {tangential, torsional, rolling}.
SolMix float
ContactSolRef TArray<float> Contact solref: {time_constant, damping_ratio}. Leave empty for MuJoCo defaults.
ContactSolImp TArray<float> Contact solimp: 5-element impedance vector.
EdgeStiffness float
EdgeDamping float
bEdgeEquality bool Emit equality constraints per edge. Pairs with EdgeSolRef/EdgeSolImp.
EdgeSolRef TArray<float> Edge solref: {time_constant, damping_ratio}. Only has effect when bEdgeEquality=true.
EdgeSolImp TArray<float> Edge solimp: 5-element impedance vector. Only has effect when bEdgeEquality=true.
Young float
Poisson float
Damping float
Thickness float
Elastic2D int32 2D passive forces mode: 0=none, 1=bending, 2=stretching, 3=both.
PinIds TArray<int32>
PinGridRange TArray<int32>

Pos

Override-enabled (false)

  • Type: FVector
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Spatial Pose

Quat

Override-enabled (false)

  • Type: FQuat
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Orientation

group

Override-enabled (bOverride_group)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

dim

Override-enabled (bOverride_dim)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

radius

Override-enabled (bOverride_radius)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

rigid

Override-enabled (bOverride_rigid)

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

mass

Override-enabled (bOverride_mass)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

inertiabox

Override-enabled (bOverride_inertiabox)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

file

Override-enabled (bOverride_file)

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

material

Override-enabled (bOverride_material)

  • Type: FString
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

rgba

Override-enabled (bOverride_rgba)

  • Type: FLinearColor
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

flatskin

Override-enabled (bOverride_flatskin)

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp

FlexcompType

Override-enabled (bOverride_FlexcompType)

  • Type: EMjFlexcompType
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|MjFlexcomp

FlexcompDof

Override-enabled (bOverride_FlexcompDof)

  • Type: EMjFlexcompDof
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|MjFlexcomp

ConType

Override-enabled (bOverride_ConType)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

ConAffinity

Override-enabled (bOverride_ConAffinity)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

ConDim

Override-enabled (bOverride_ConDim)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

Priority

Override-enabled (bOverride_Priority)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

Margin

Override-enabled (bOverride_Margin)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

Gap

Override-enabled (bOverride_Gap)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

SelfCollide

Override-enabled (bOverride_SelfCollide)

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

bInternal

Override-enabled (bOverride_Internal)

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

Friction

Contact friction: {tangential, torsional, rolling}.

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact
  • Notes: Override-enabled (bOverride_Friction)

SolMix

Override-enabled (bOverride_SolMix)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact

ContactSolRef

Contact solref: {time_constant, damping_ratio}. Leave empty for MuJoCo defaults.

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact
  • Notes: Override-enabled (bOverride_ContactSolRef)

ContactSolImp

Contact solimp: 5-element impedance vector.

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Contact
  • Notes: Override-enabled (bOverride_ContactSolImp)

EdgeStiffness

Override-enabled (bOverride_EdgeStiffness)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Edge

EdgeDamping

Override-enabled (bOverride_EdgeDamping)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Edge

bEdgeEquality

Emit equality constraints per edge. Pairs with EdgeSolRef/EdgeSolImp.

  • Type: bool
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Edge
  • Notes: Override-enabled (bOverride_EdgeEquality)

EdgeSolRef

Edge solref: {time_constant, damping_ratio}. Only has effect when bEdgeEquality=true.

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Edge
  • Notes: Override-enabled (bOverride_EdgeSolRef)

EdgeSolImp

Edge solimp: 5-element impedance vector. Only has effect when bEdgeEquality=true.

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Edge
  • Notes: Override-enabled (bOverride_EdgeSolImp)

Young

Override-enabled (bOverride_Young)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Elasticity

Poisson

Override-enabled (bOverride_Poisson)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Elasticity

Damping

Override-enabled (bOverride_Damping)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Elasticity

Thickness

Override-enabled (bOverride_Thickness)

  • Type: float
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Elasticity

Elastic2D

2D passive forces mode: 0=none, 1=bending, 2=stretching, 3=both.

  • Type: int32
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Elasticity
  • Notes: Override-enabled (bOverride_Elastic2D)

PinIds

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Pin

PinGridRange

  • Type: TArray
  • Editor: ✏️ EditAnywhere
  • Blueprint: 🔵 ReadWrite
  • Category: MuJoCo|Flexcomp|Pin

Private Properties

Property Type Description
bIsRegistered bool Set once RegisterToSpec succeeds — prevents double-registration from
RawToWelded TArray<int32> Remap from raw UE vertex index → welded MuJoCo flex vertex index.
NumRenderVerts int32 Number of raw UE vertices.

bIsRegistered

Set once RegisterToSpec succeeds — prevents double-registration from

  • Type: bool

RawToWelded

Remap from raw UE vertex index → welded MuJoCo flex vertex index.

  • Type: TArray

NumRenderVerts

Number of raw UE vertices.

  • Type: int32

Functions

Public Functions

General

Function Returns Description
BuildSchemaAttrsXml() FString Build the <flexcomp ...> attribute string from codegen-owned
BuildSchemaAttrsXml

Build the <flexcomp ...> attribute string from codegen-owned

  • Signature: BuildSchemaAttrsXml()
  • Returns: FString

Private Functions

General

Function Returns Description
CaptureRenderData() void Captures raw UE vertex data (UVs, tangents, indices) from the child
BuildFlexcompXml() FString Serializes this flexcomp's properties back to an MJCF fragment.
ExportMeshToVFS() FString Exports the child StaticMeshComponent's mesh to an OBJ file in the wrapper's VFS.
CaptureRenderData

Captures raw UE vertex data (UVs, tangents, indices) from the child

  • Signature: CaptureRenderData()
BuildFlexcompXml

Serializes this flexcomp's properties back to an MJCF fragment.

  • Signature: BuildFlexcompXml(const FString& MeshAssetName)
  • Returns: FString
ExportMeshToVFS

Exports the child StaticMeshComponent's mesh to an OBJ file in the wrapper's VFS.