UClothingAssetCommon

Implementation of non-solver specific, but common Engine related functionality.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

ClothingSystemRuntimeCommon

Header

/Engine/Source/Runtime/ClothingSystemRuntimeCommon/Public/ClothingAsset.h

Include

#include "ClothingAsset.h"

Syntax

class UClothingAssetCommon : public UClothingAssetBase

Remarks

Implementation of non-solver specific, but common Engine related functionality.

Solver specific implementations may wish to override this class to construct their own default instances of child classes, such as ClothSimConfig_ and CustomData, as well as override the `AddNewLod() factory to build their own implementation of `UClothLODDataBase_.

Variables

Name Description

Public variable

TMap< FName, TO...

 

ClothConfigs

Simulation specific cloth parameters.

Public variable

TObjectPtr< UCl...

 

CustomData

Custom data applied by the importer depending on where the asset was imported from.

Public variable

TArray< FClothL...

 

LodData

The actual asset data, listed by LOD.

Public variable

TArray< int32 >

 

LodMap

Tracks which clothing LOD each skel mesh LOD corresponds to (LodMap[SkelLod]=ClothingLod).

Public variable

TObjectPtr< UPh...

 

PhysicsAsset

The physics asset to extract collisions from when building a simulation.

Public variable

int32

 

ReferenceBoneIndex

Bone to treat as the root of the simulation space.

Public variable

TArray< int32 >

 

UsedBoneIndices

List of the indices for the bones in UsedBoneNames, used for remapping.

Public variable

TArray< FName >

 

UsedBoneNames

List of bones this asset uses inside its parent mesh.

Constructors

Name Description

Public function

UClothingAssetCommon

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

ApplyParameterMasks

(
    bool bUpdateFixedVertData
)

Callback envoked after weights have been edited.

Public function

void

 

CalculateReferenceBoneIndex()

Calculates the preferred root bone for the simulation.

Public function

ClothConfigT...

 

GetClothConfig()

Return a cloth config pointer of the desired cloth config type, or nullptr if there isn't any suitable.

Public function Const

const ClothC...

 

GetClothConfig()

Return a const cloth config pointer of the desired cloth config type, or nullptr if there isn't any suitable.

Public function

void

 

InvalidateFlaggedCachedData

(
    EClothingCachedDataFlagsCommon Flag...
)

Called on the clothing asset when the base data (physical mesh, config etc.) has changed, so any intermediate generated data can be regenerated.

Overridden from UClothingAssetBase

Name Description

Public function Virtual

int32

 

AddNewLod()

  • Add a new LOD class instance.

Public function Virtual

bool

 

BindToSkeletalMesh

(
    USkeletalMesh* InSkelMesh,
    const int32 InMeshLodIndex,
    const int32 InSectionIndex,
    const int32 InAssetLodIndex
)

Create weights for skinning the render mesh to our simulation mesh, and weights to drive our sim mesh from the skeleton.

Public function Virtual

void

 

BuildLodTransitionData()

Builds the LOD transition data.

Public function Virtual Const

int32

 

GetNumLods()

Returns the number of valid LOD's (length of the `ClothLodData_ array).

Public function Virtual

void

 

InvalidateAllCachedData()

Called on the clothing asset when the base data (physical mesh, config etc.) has changed, so any intermediate generated data can be regenerated.

Public function Virtual Const

bool

 

IsValidLod

(
    int32 InLodIndex
)

Returns true_ if InLodIndex is a valid LOD id (index into `ClothLodData).

Public function Virtual

void

 

PostUpdateAllAssets()

Propagate the shared simulation configs between assets.

Public function Virtual

void

 

RefreshBoneMapping

(
    USkeletalMesh* InSkelMesh
)

Rebuilds the UsedBoneIndices_ array from looking up the entries in the UsedBoneNames array, in the `InSkelMesh's reference skeleton.

Public function Virtual

void

 

UnbindFromSkeletalMesh

(
    USkeletalMesh* InSkelMesh
)

Helper that invokes [UnbindFromSkeletalMesh()](API\Runtime\ClothingSystemRuntimeCommon\UClothingAssetCommon\UnbindFromSkelet-\1)_ for each avilable entry in InSkelMesh->GetImportedModel()'s_ LODModel.

Public function Virtual

void

 

UnbindFromSkeletalMesh

(
    USkeletalMesh* InSkelMesh,
    const int32 InMeshLodIndex
)

Unbinds this clothing asset from the provided skeletal mesh

Public function Virtual

void

 

UpdateAllLODBiasMappings

(
    USkeletalMesh* SkeletalMesh
)

Update all extra LOD deformer mappings.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeChainProperty

(
    FPropertyChangedChainEvent& ChainE...
)

Called after changes in any of the asset properties.

Public function Virtual

void

 

PostLoad()

Migrate deprecated objects.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Serialize deprecated objects.

Deprecated Variables

Name Description

Public variable

TObjectPtr< UCl...

 

ChaosClothSimConfig_DEPRECATED

Parameters for how Chaos cloth behaves These will not affect NVcloth For now, we have two configuration parameters so that we can switch between chaos and non chaos at will without losing the original NVcloth data

Public variable

FClothConfig_Le...

 

ClothConfig_DEPRECATED

Deprecated property for transitioning the FClothConfig_ struct to the UClothConfigBase array, in a new property called `ClothConfigs.

Public variable

TArray< TObject...

 

ClothLodData_DEPRECATED

  1. Use LodData instead.

Public variable

TObjectPtr< UCl...

 

ClothSharedSimConfig_DEPRECATED

Shared by all cloth instances in a skeletal mesh Only supported with Chaos Cloth for now This may not be editable on unused cloth assets

Public variable

TObjectPtr< UCl...

 

ClothSimConfig_DEPRECATED

Parameters for how the NVcloth behaves. These will have no effect on Chaos cloth

Deprecated Functions

Name Description

Public function Virtual

void

 

BuildSelfCollisionData()

Cached data are now all rebuilt by calling InvalidateCachedData