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 |
|---|---|---|
Type |
EMjFlexcompType | |
Dim |
int32 |
|
DofType |
EMjFlexcompDof | |
Count |
FIntVector |
|
Spacing |
FVector |
|
Mass |
float |
|
InertiaBox |
float |
|
Radius |
float |
|
Rgba |
FLinearColor |
|
Scale |
FVector |
|
bRigid |
bool |
|
bFlatSkin |
bool |
|
MeshFile |
FString |
|
PointData |
TArray<double> |
|
ElementData |
TArray<int32> |
|
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> |
Type¶
- Type: EMjFlexcompType
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
Dim¶
- Type: int32
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
DofType¶
- Type: EMjFlexcompDof
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
Count¶
- Type: FIntVector
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
Spacing¶
- Type: FVector
- 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
Radius¶
Override-enabled (
bOverride_Radius)
- Type: float
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
Rgba¶
Override-enabled (
bOverride_Rgba)
- Type: FLinearColor
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
Scale¶
Override-enabled (
bOverride_Scale)
- Type: FVector
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
bRigid¶
- Type: bool
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
bFlatSkin¶
- Type: bool
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
MeshFile¶
- Type: FString
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp
PointData¶
- Type: TArray
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp|Direct
ElementData¶
- Type: TArray
- Editor: ✏️ EditAnywhere
- Blueprint: 🔵 ReadWrite
- Category: MuJoCo|Flexcomp|Direct
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. |
Functions¶
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 |
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.
- Signature:
ExportMeshToVFS(class FMujocoSpecWrapper& Wrapper) - Returns: FString