UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GeometryCollectionEngineConversion.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
5#include "Engine/World.h"
6
7class UStaticMesh;
8class USkeletalMesh;
9class USkeleton;
10class USkeletalMeshComponent;
16class UBodySetup;
18struct FMeshDescription;
19
22
27{
28public:
29
34
41
50
62 FGeometryCollection* GeometryCollection, UBodySetup* BodySetup = nullptr, bool bReindexMaterials = true, bool bAddInternalMaterials = true, bool bSetInternalFromMaterialIndex = false);
63
69
80 UGeometryCollection* GeometryCollectionObject, bool bReindexMaterials = true, bool bAddInternalMaterials = true, bool bSplitComponents = false, bool bSetInternalFromMaterialIndex = false);
81
82 // TODO: consider having the below fn return bool, and have a helper that returns the StartMaterialIndex from UGeometryCollection
83 // before any materials are actually added, so we can call the AppendMaterial function after, and not need to use its return value ...
84 // This would let the is-there-a-valid-mesh logic live inside this function
85 // NOTE: and similar change will need to propagate to similar places ...
86
97 FGeometryCollection* GeometryCollection, bool bReindexMaterials = true, bool bAddInternalMaterials = true, bool bSplitComponents = false, bool bSetInternalFromMaterialIndex = false);
98
105 static GEOMETRYCOLLECTIONENGINE_API void AppendStaticMesh(const UStaticMesh* StaticMesh, const UStaticMeshComponent *StaticMeshComponent, const FTransform& StaticMeshTransform, UGeometryCollection* GeometryCollection,
106 bool bReindexMaterials = true, bool bAddInternalMaterials = true, bool bSplitComponents = false, bool bSetInternalFromMaterialIndex = false);
107
114 static GEOMETRYCOLLECTIONENGINE_API void AppendSkeletalMesh(const USkeletalMesh* SkeletalMesh, const USkeletalMeshComponent *SkeletalMeshComponent, const FTransform& SkeletalMeshTransform, UGeometryCollection* GeometryCollection, bool bReindexMaterials = true);
115
124
132
140
142
144
146
157
166
174
183
196
206
217
225
233
236
237private:
245 static bool AppendGeometryCollectionSourceNoMaterial(const FGeometryCollectionSource& GeometryCollectionSource, FGeometryCollection& GeometryCollectionInOut, int32 StartMaterialIndex, bool ReindexMaterials = true);
246};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
TTuple< const USkeletalMesh *, const USkeletalMeshComponent *, FTransform > GeometryCollectionSkeletalMeshConversionTuple
Definition GeometryCollectionEngineConversion.h:21
TTuple< const UStaticMesh *, const UStaticMeshComponent *, FTransform > GeometryCollectionStaticMeshConversionTuple
Definition GeometryCollectionEngineConversion.h:20
Definition Actor.h:257
Definition GeometryCollectionEngineConversion.h:27
static GEOMETRYCOLLECTIONENGINE_API int32 AppendMaterials(const TArray< UMaterialInterface * > &Materials, UGeometryCollection *GeometryCollectionObject, bool bAddInteriorCopy)
Definition GeometryCollectionEngineConversion.cpp:540
static GEOMETRYCOLLECTIONENGINE_API void AppendAutoInstanceMeshIndices(UGeometryCollection *GeometryCollectionObject, int32 FromTransformIndex, const UStaticMesh *StaticMesh, const TArray< UMaterialInterface * > &Materials)
Definition GeometryCollectionEngineConversion.cpp:567
static GEOMETRYCOLLECTIONENGINE_API void AppendSkeletalMesh(const USkeletalMesh *SkeletalMesh, const USkeletalMeshComponent *SkeletalMeshComponent, const FTransform &SkeletalMeshTransform, UGeometryCollection *GeometryCollection, bool bReindexMaterials=true)
Definition GeometryCollectionEngineConversion.cpp:1511
static GEOMETRYCOLLECTIONENGINE_API void AppendMeshDescription(const FMeshDescription *MeshDescription, const FString &Name, int32 StartMaterialIndex, const FTransform &StaticMeshTransform, FGeometryCollection *GeometryCollection, UBodySetup *BodySetup=nullptr, bool bReindexMaterials=true, bool bAddInternalMaterials=true, bool bSetInternalFromMaterialIndex=false)
Definition GeometryCollectionEngineConversion.cpp:164
static GEOMETRYCOLLECTIONENGINE_API void ConvertStaticMeshToGeometryCollection(const TObjectPtr< UStaticMesh > StaticMesh, FManagedArrayCollection &OutCollection, TArray< TObjectPtr< UMaterial > > &OutMaterials, TArray< FGeometryCollectionAutoInstanceMesh > &OutInstancedMeshes, bool bSetInternalFromMaterialIndex=true, bool bSplitComponents=false)
Definition GeometryCollectionEngineConversion.cpp:1613
static GEOMETRYCOLLECTIONENGINE_API void GetMaterialsFromInstances(const TArray< TObjectPtr< UMaterialInterface > > &MaterialInstances, TArray< TObjectPtr< UMaterial > > &OutMaterials)
Definition GeometryCollectionEngineConversion.cpp:2132
static GEOMETRYCOLLECTIONENGINE_API FMeshDescription * GetMaxResMeshDescriptionWithNormalsAndTangents(const UStaticMesh *StaticMesh)
Definition GeometryCollectionEngineConversion.cpp:513
static GEOMETRYCOLLECTIONENGINE_API int32 AppendGeometryCollectionMaterials(const UGeometryCollection *SourceGeometryCollection, const UGeometryCollectionComponent *GeometryCollectionComponent, UGeometryCollection *TargetGeometryCollectionObject)
Definition GeometryCollectionEngineConversion.cpp:1068
static GEOMETRYCOLLECTIONENGINE_API void ConvertCollectionToSkeleton(const FManagedArrayCollection &InCollection, USkeleton *OutSkeleton, TArray< int32 > &OutIndexRemap, bool bCenterBonesOnGeometry=false)
Definition GeometryCollectionEngineConversion.cpp:1794
static GEOMETRYCOLLECTIONENGINE_API bool AppendGeometryCollection(const FGeometryCollection *SourceGeometryCollection, int32 MaterialStartIndex, const FTransform &GeometryCollectionTransform, FGeometryCollection *TargetGeometryCollection, bool bReindexMaterials=true)
Definition GeometryCollectionEngineConversion.cpp:779
static GEOMETRYCOLLECTIONENGINE_API void AppendGeometryCollectionSource(const FGeometryCollectionSource &GeometryCollectionSource, FGeometryCollection &GeometryCollectionInOut, TArray< UMaterial * > &MaterialsInOut, bool ReindexMaterials=true)
Definition GeometryCollectionEngineConversion.cpp:1551
static GEOMETRYCOLLECTIONENGINE_API int32 AppendSkeletalMeshMaterials(const USkeletalMesh *SkeletalMesh, const USkeletalMeshComponent *SkeletalMeshComponent, UGeometryCollection *GeometryCollectionObject)
Definition GeometryCollectionEngineConversion.cpp:1530
static GEOMETRYCOLLECTIONENGINE_API void ConvertGeometryCollectionToGeometryCollection(const TObjectPtr< UGeometryCollection > InGeometryCollectionAssetPtr, FManagedArrayCollection &OutCollection, TArray< TObjectPtr< UMaterial > > &OutMaterials, TArray< FGeometryCollectionAutoInstanceMesh > &OutInstancedMeshes)
Definition GeometryCollectionEngineConversion.cpp:1679
static GEOMETRYCOLLECTIONENGINE_API void AppendSkeleton(const USkeleton *Skeleton, const FTransform &SkeletalMeshTransform, FManagedArrayCollection *InCollection)
Definition GeometryCollectionEngineConversion.cpp:1450
static GEOMETRYCOLLECTIONENGINE_API void AppendGeometryCollectionInstancedMeshes(const UGeometryCollection *SourceGeometryCollectionObject, UGeometryCollection *TargetGeometryCollectionObject, int32 TargetTransformStartIndex)
Definition GeometryCollectionEngineConversion.cpp:1091
static GEOMETRYCOLLECTIONENGINE_API bool AppendStaticMesh(const UStaticMesh *StaticMesh, const TArray< UMaterialInterface * > &Materials, const FTransform &StaticMeshTransform, UGeometryCollection *GeometryCollectionObject, bool bReindexMaterials=true, bool bAddInternalMaterials=true, bool bSplitComponents=false, bool bSetInternalFromMaterialIndex=false)
Definition GeometryCollectionEngineConversion.cpp:590
static GEOMETRYCOLLECTIONENGINE_API const FSkeletalMeshLODRenderData * GetSkeletalMeshLOD(const USkeletalMesh *SkeletalMesh, int32 LOD)
Definition GeometryCollectionEngineConversion.cpp:1496
static GEOMETRYCOLLECTIONENGINE_API void ConvertCollectionToSkeletalMesh(const FManagedArrayCollection &InCollection, const TArray< TObjectPtr< UMaterialInterface > > InMaterials, USkeletalMesh &OutSkeletalMesh, USkeleton &OutSkeleton)
Definition GeometryCollectionEngineConversion.cpp:1916
static GEOMETRYCOLLECTIONENGINE_API void ConvertActorToGeometryCollection(const AActor *Actor, FManagedArrayCollection &OutCollection, TArray< TObjectPtr< UMaterial > > &OutMaterials, TArray< FGeometryCollectionAutoInstanceMesh > &OutInstancedMeshes, const FSkeletalMeshToCollectionConversionParameters &ConversionParameters, bool bSplitComponents=false)
Definition GeometryCollectionEngineConversion.cpp:1706
Definition GeometryCollection.h:32
Definition SkeletalMeshLODRenderData.h:128
Definition Array.h:670
Definition BodySetup.h:128
Definition GeometryCollectionComponent.h:578
Definition GeometryCollectionObject.h:393
Definition MaterialInterface.h:296
Definition SkeletalMesh.h:440
Definition Skeleton.h:295
Definition StaticMesh.h:593
Definition CollectionBoundsFacade.cpp:13
bool bParentAllBonesUnderNewRoot
Definition GeometryCollectionEngineConversion.h:32
Definition GeometryCollectionObject.h:31
Definition ManagedArrayCollection.h:56
Definition MeshDescription.h:94
Definition ObjectPtr.h:488
Definition Tuple.h:652