Navigation
API > API/Plugins > API/Plugins/GeometryScriptingCore > API/Plugins/GeometryScriptingCore/UGeometryScriptLibrary_StaticMes-
Description
Extracts the Material List and corresponding Material Indices from the specified LOD of the Static Mesh Asset. The MaterialList is sorted by Section, so if CopyMeshToStaticMesh was used to create a DynamicMesh with bUseSectionMaterials=true, then the returned MaterialList here will correspond to the MaterialIDs in that DynamicMesh (as each Static Mesh Section becomes a MaterialID, in-order). So, the returned MaterialList can be passed directly to (eg) a DynamicMeshComponent.
Note that the LOD Index in RequestedLOD will be silently clamped to the available number of LODs (SourceModel or RenderData)
| Name | GetSectionMaterialListFromStaticMesh |
| Type | function |
| Header File | /Engine/Plugins/Runtime/GeometryScripting/Source/GeometryScriptingCore/Public/GeometryScript/MeshAssetFunctions.h |
| Include Path | #include "GeometryScript/MeshAssetFunctions.h" |
| Source | /Engine/Plugins/Runtime/GeometryScripting/Source/GeometryScriptingCore/Private/MeshAssetFunctions.cpp |
UFUNCTION (BlueprintCallable, Category="GeometryScript|StaticMesh",
Meta=(ExpandEnumAsExecs="Outcome"))
static void GetSectionMaterialListFromStaticMesh
(
UStaticMesh * FromStaticMeshAsset,
FGeometryScriptMeshReadLOD RequestedLOD,
TArray < UMaterialInterface * > & MaterialList,
TArray < int32 > & MaterialIndex,
TArray < FName > & MaterialSlotNames,
EGeometryScriptOutcomePins & Outcome,
UGeometryScriptDebug * Debug
)
Parameters
| Name | Remarks |
|---|---|
| MaterialIndex | this returned array is the same size as MaterialList, with each value the index of that Material in the StaticMesh Material List |
| MateriaSlotNames | this returned array is the same size as MaterialList, with each value the Slot Name of that Material in the StaticMesh Material List |