Navigation
API > API/Plugins > API/Plugins/MLDeformerFrameworkEditor > API/Plugins/MLDeformerFrameworkEditor/FMLDeformerEditorModel
Description
Change the skeletal mesh on a specific skeletal mesh component. This internally will not only call SkelMeshComponent->SetSkeletalMesh(Mesh), but also will reassign the materials. The reason for this is that if there are material instances set already, the skeletal mesh component will not override them to preserve changes done by the user. This helper function will force these to be updated as well. This was needed in case of Metahumans. Metahumans use a PostProcessAnimBP with a ControlRig node in it, which drives material curves. In order to drive this, material instances are needed instead of regular materials. But as mentioned before, when switching the mesh the code internally will not override the material instances. So we simply have to force this manually, hence this function.
| Name | ChangeSkeletalMeshOnComponent |
| Type | function |
| Header File | /Engine/Plugins/Animation/MLDeformer/MLDeformerFramework/Source/MLDeformerFrameworkEditor/Public/MLDeformerEditorModel.h |
| Include Path | #include "MLDeformerEditorModel.h" |
| Source | /Engine/Plugins/Animation/MLDeformer/MLDeformerFramework/Source/MLDeformerFrameworkEditor/Private/MLDeformerEditorModel.cpp |
static void ChangeSkeletalMeshOnComponent
(
USkeletalMeshComponent * SkelMeshComponent,
USkeletalMesh * Mesh
)
Parameters
| Name | Remarks |
|---|---|
| SkelMeshComponent | The skeletal mesh component to change the mesh for. |
| Mesh | The new mesh to use. |