UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
MeshVertexChange.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreMinimal.h"
7#include "UObject/Interface.h"
9#include "VectorTypes.h"
10#include "MeshVertexChange.generated.h"
11
13
54
55
57{
58 None = 0,
60 VertexColors = 2,
61 OverylayUVs = 4,
63};
65
66
71{
72public:
75 bool bSavePositions = true;
76 bool bSaveColors = false;
77
78 bool bSaveOverlayNormals = false;
80
81 bool bSaveOverlayUVs = false;
83
86
89
90 GEOMETRYFRAMEWORK_API void SaveVertexInitial(const FDynamicMesh3* Mesh, int32 VertexID);
91 GEOMETRYFRAMEWORK_API void SaveVertexFinal(const FDynamicMesh3* Mesh, int32 VertexID);
92
93 template<typename Enumerable>
94 void SaveVertices(const FDynamicMesh3* Mesh, Enumerable Enum, bool bInitial);
95
98
100 GEOMETRYFRAMEWORK_API void SaveOverlayUVs(const FDynamicMesh3* Mesh, const TSet<int32>& ElementIDs, bool bInitial);
101
102public:
103 // currently only used in vertex sculpt tool. cannot be used if bSaveColors = true
104 GEOMETRYFRAMEWORK_API void UpdateVertex(int32 VertexID, const FVector3d& OldPosition, const FVector3d& NewPosition);
105
106 // currently only used in element paint tool. Can only be used if bSaveColors=true and bSavePositions=false
107 GEOMETRYFRAMEWORK_API void UpdateVertexColor(int32 VertexID, const FVector3f& OldColor, const FVector3f& NewColor);
108
109protected:
111
114
117};
118
119
120
121UINTERFACE(MinimalAPI)
130{
132public:
133 virtual void ApplyChange(const FMeshVertexChange* Change, bool bRevert) = 0;
134};
135
136
137
138
139
140template<typename Enumerable>
142{
143 if (bInitial)
144 {
145 for (int32 k : Enum)
146 {
148 }
149 }
150 else
151 {
152 for (int32 k : Enum)
153 {
155 }
156 }
157}
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
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
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define PREDECLARE_USE_GEOMETRY_CLASS(ClassName)
Definition GeometryBase.h:17
EMeshVertexChangeComponents
Definition MeshVertexChange.h:57
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UINTERFACE(...)
Definition ObjectMacros.h:780
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition MeshRegionChange.h:11
Definition MeshVertexChange.h:71
GEOMETRYFRAMEWORK_API void UpdateOverlayUV(int32 ElementID, const FVector2f &OldUV, const FVector2f &NewUV)
Definition MeshVertexChange.cpp:261
GEOMETRYFRAMEWORK_API void SaveOverlayNormals(const FDynamicMesh3 *Mesh, const TArray< int32 > &ElementIDs, bool bInitial)
bool bSaveOverlayUVs
Definition MeshVertexChange.h:81
void SaveVertices(const FDynamicMesh3 *Mesh, Enumerable Enum, bool bInitial)
Definition MeshVertexChange.h:141
TMap< int32, int32 > SavedNormalElements
Definition MeshVertexChange.h:79
bool bSavePositions
Definition MeshVertexChange.h:75
GEOMETRYFRAMEWORK_API void UpdateOverlayNormal(int32 ElementID, const FVector3f &OldNormal, const FVector3f &NewNormal)
Definition MeshVertexChange.cpp:178
TMap< int32, int32 > SavedVertices
Definition MeshVertexChange.h:74
GEOMETRYFRAMEWORK_API void UpdateVertex(int32 VertexID, const FVector3d &OldPosition, const FVector3d &NewPosition)
Definition MeshVertexChange.cpp:59
GEOMETRYFRAMEWORK_API FMeshVertexChangeBuilder()
Definition MeshVertexChange.cpp:36
GEOMETRYFRAMEWORK_API void SaveOverlayUVs(const FDynamicMesh3 *Mesh, const TArray< int32 > &ElementIDs, bool bInitial)
GEOMETRYFRAMEWORK_API void SaveVertexInitial(const FDynamicMesh3 *Mesh, int32 VertexID)
Definition MeshVertexChange.cpp:110
GEOMETRYFRAMEWORK_API void UpdateVertexColor(int32 VertexID, const FVector3f &OldColor, const FVector3f &NewColor)
Definition MeshVertexChange.cpp:77
TMap< int32, int32 > SavedUVElements
Definition MeshVertexChange.h:82
GEOMETRYFRAMEWORK_API void UpdateOverlayNormalFinal(int32 ElementID, const FVector3f &NewNormal)
Definition MeshVertexChange.cpp:195
bool bSaveOverlayNormals
Definition MeshVertexChange.h:78
GEOMETRYFRAMEWORK_API void SaveVertexFinal(const FDynamicMesh3 *Mesh, int32 VertexID)
Definition MeshVertexChange.cpp:150
GEOMETRYFRAMEWORK_API void UpdateOverlayUVFinal(int32 ElementID, const FVector2f &NewUV)
Definition MeshVertexChange.cpp:278
GEOMETRYFRAMEWORK_API void SaveOverlayNormals(const FDynamicMesh3 *Mesh, const TSet< int32 > &ElementIDs, bool bInitial)
TUniqueFunction< void(int32, int32)> OnNewVertexSaved
Definition MeshVertexChange.h:85
GEOMETRYFRAMEWORK_API void SaveOverlayUVs(const FDynamicMesh3 *Mesh, const TSet< int32 > &ElementIDs, bool bInitial)
bool bSaveColors
Definition MeshVertexChange.h:76
TUniquePtr< FMeshVertexChange > Change
Definition MeshVertexChange.h:73
GEOMETRYFRAMEWORK_API void UpdateVertexFinal(int32 VertexID, const FVector3d &NewPosition)
Definition MeshVertexChange.cpp:95
Definition MeshVertexChange.h:22
virtual GEOMETRYFRAMEWORK_API void Apply(UObject *Object) override
Definition MeshVertexChange.cpp:12
bool bHaveOverlayUVs
Definition MeshVertexChange.h:37
TArray< FVector3d > NewPositions
Definition MeshVertexChange.h:28
virtual GEOMETRYFRAMEWORK_API FString ToString() const override
Definition MeshVertexChange.cpp:30
bool bHaveOverlayNormals
Definition MeshVertexChange.h:32
bool bHaveVertexColors
Definition MeshVertexChange.h:25
bool bHaveVertexPositions
Definition MeshVertexChange.h:24
virtual GEOMETRYFRAMEWORK_API void ProcessChangeVertices(const UE::Geometry::FDynamicMesh3 *ChangedMesh, TFunctionRef< void(TConstArrayView< int32 >)> ProcessFn, bool bRevert) const override
Definition MeshVertexChange.cpp:24
TArray< FVector2f > OldUVs
Definition MeshVertexChange.h:39
TArray< FVector2f > NewUVs
Definition MeshVertexChange.h:40
TArray< FVector3d > OldPositions
Definition MeshVertexChange.h:27
TArray< FVector3f > NewColors
Definition MeshVertexChange.h:30
TArray< FVector3f > OldNormals
Definition MeshVertexChange.h:34
TArray< FVector3f > OldColors
Definition MeshVertexChange.h:29
TArray< int32 > UVs
Definition MeshVertexChange.h:38
virtual GEOMETRYFRAMEWORK_API void Revert(UObject *Object) override
Definition MeshVertexChange.cpp:18
TArray< int32 > Normals
Definition MeshVertexChange.h:33
TArray< FVector3f > NewNormals
Definition MeshVertexChange.h:35
TArray< int32 > Vertices
Definition MeshVertexChange.h:26
Definition MeshVertexChange.h:130
virtual void ApplyChange(const FMeshVertexChange *Change, bool bRevert)=0
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition UnrealString.h.inl:34
Definition FunctionFwd.h:19
Definition UniquePtr.h:107
Definition DynamicMesh3.h:108
Definition Interface.h:19
Definition MeshVertexChange.h:123
Definition Object.h:95