MeshPaintHelpers

Unreal Engine C++ API Reference > Editor > MeshPaint

References

   
Module MeshPaint
Header /Engine/Source/Editor/MeshPaint/Public/MeshPaintHelpers.h
Include #include "MeshPaintHelpers.h"

Syntax

class MeshPaintHelpers  

Functions

Type Name Description
void ApplyBrushToVertex ( const FVector& VertexPosition, const FMatrix& InverseBrushMatrix, const float BrushRadius, const float BrushFalloffAmount, const float BrushStrength, const T& PaintValue, T& InOutValue )  
void ApplyFillWithMask ( FColor& InOutColor, const FColor& MaskColor, const FColor& FillColor )  
bool ApplyPerTrianglePaintAction ( IMeshPaintGeometryAdapter* Ada..., const FVector& CameraPosition, const FVector& HitPosition, const UPaintBrushSettings* Set..., FPerTrianglePaintAction Action ) Given the adapter, settings and view-information retrieves influences triangles and applies Action to them
bool ApplyPerVertexPaintAction ( FPerVertexPaintActionArgs& InArgs, FPerVertexPaintAction Action ) Given arguments for an action, and an action - retrieves influences vertices and applies Action to them
void ApplyVertexColorPaint ( const FMeshPaintParameters& InPara..., const FLinearColor& OldColor, FLinearColor& NewColor, const float PaintAmount ) Applies Vertex Color Painting according to the given parameters
void ApplyVertexColorsToAllLODs ( IMeshPaintGeometryAdapter& Geometr..., USkeletalMeshComponent* Skelet... ) Applies the vertex colors found in LOD level 0 to all contained LOD levels in the SkeletalMeshComponent
void ApplyVertexColorsToAllLODs ( IMeshPaintGeometryAdapter& Geometr..., UStaticMeshComponent* StaticMe... ) Applies the vertex colors found in LOD level 0 to all contained LOD levels in the StaticMeshComponent
void ApplyVertexColorsToAllLODs ( IMeshPaintGeometryAdapter& Geometr..., UMeshComponent* InMeshComponen... ) Applies vertex color painting found on LOD 0 to all lower LODs.
void ApplyVertexWeightPaint ( const FMeshPaintParameters& InPara..., const FLinearColor& OldColor, const float PaintAmount, FLinearColor& NewColor ) Applies Vertex Blend Weight Painting according to the given parameters
void ClearMeshTextureOverrides ( const IMeshPaintGeometryAdapter& G..., UMeshComponent* InMeshComponen... ) Clears all texture overrides for this component.
float ComputePaintMultiplier ( float SquaredDistanceToVertex2D, float BrushStrength, float BrushInnerRadius, float BrushRadialFalloff, float BrushInnerDepth, float BrushDepthFallof, float VertexDepthToBrush ) Computes the Paint power multiplier value
bool DoesMeshComponentContainPerLODColors ( const UMeshComponent* MeshComp... ) Checks whether or not the mesh components contains per lod colors (for all LODs)
void FillSkeletalMeshVertexColors ( USkeletalMeshComponent* MeshCo..., int32 LODIndex, const FColor FillColor, const FColor MaskColor )  
void FillStaticMeshVertexColors ( UStaticMeshComponent* MeshComp..., int32 LODIndex, const FColor FillColor, const FColor MaskColor ) Fills all vertex colors for all LODs found in the given mesh component with Fill Color
void ForceRenderMeshLOD ( UMeshComponent* Component, int32 LODIndex ) Forces the component to render LOD level at LODIndex instead of the view-based LOD level ( X = 0 means do not force the LOD, X > 0 means force the lod to X - 1 )
FLinearColor GenerateColorForTextureWeight ( const int32 NumWeights, const int32 WeightIndex ) Generate texture weight color for given number of weights and the to-paint index
TArray< FCol... GetColorDataForLOD ( const UStaticMesh* StaticMesh, int32 LODIndex ) Retrieves the vertex colors from the given LOD level in the Static Mesh
TArray< FCol... GetInstanceColorDataForLOD ( const UStaticMeshComponent* Me..., int32 LODIndex ) Retrieves the per-instance vertex colors from the given LOD level in the StaticMeshComponent
void GetInstanceColorDataInfo ( const UStaticMeshComponent* St..., int32 LODIndex, int32& OutTotalInstanceVertexColor... ) Retrieves the number of bytes used to store the per-instance LOD vertex color data from the static mesh component
int32 GetNumberOfLODs ( const UMeshComponent* MeshComp... ) Returns the number of Mesh LODs for the given MeshComponent
int32 GetNumberOfUVs ( const UMeshComponent* MeshComp..., int32 LODIndex ) Returns the number of Texture Coordinates for the given MeshComponent
bool GetPerVertexPaintInfluencedVertices ( FPerVertexPaintActionArgs& InArgs, TSet< int32 >& InfluencedVertices )  
uint32 GetVertexColorBufferSize ( UMeshComponent* MeshComponent, int32 LODIndex, bool bInstance ) Retrieves the Vertex Color buffer size for the given LOD level in the Static Mesh
TArray< FVec... GetVerticesForLOD ( const UStaticMesh* StaticMesh, int32 LODIndex ) Retrieves the vertex positions from the given LOD level in the Static Mesh
void ImportVertexColorsFromTexture ( UMeshComponent* MeshComponent ) Helper function to import Vertex Colors from a Texture to the specified MeshComponent (makes use of SImportVertexColorsOptions Widget)
void ImportVertexColorsToSkeletalMesh ( USkeletalMesh* SkeletalMesh, const UVertexColorImportOptions..., UTexture2D* Texture ) Imports vertex colors from a Texture to the specified Skeletal Mesh according to user-set options
void ImportVertexColorsToStaticMesh ( UStaticMesh* StaticMesh, const UVertexColorImportOptions..., UTexture2D* Texture ) Imports vertex colors from a Texture to the specified Static Mesh according to user-set options
void ImportVertexColorsToStaticMeshComponent ( UStaticMeshComponent* StaticMe..., const UVertexColorImportOptions..., UTexture2D* Texture ) Imports vertex colors from a Texture to the specified Static Mesh Component according to user-set options
bool IsInVRMode ( const FEditorViewportClient* V... ) Checks whether or not the given Viewport Client is a VR editor viewport client
bool IsPointInfluencedByBrush ( const FVector& InPosition, const FMeshPaintParameters& InPara..., float& OutSquaredDistanceToVertex2..., float& OutVertexDepthToBrush ) Checks whether or not a point is influenced by the painting brush according to the given parameters
bool IsPointInfluencedByBrush ( const FVector2D& BrushSpacePositio..., const float BrushRadiusSquared, float& OutInRangeValue )  
bool PaintVertex ( const FVector& InVertexPosition, const FMeshPaintParameters& InPara..., FColor& InOutVertexColor ) Applies vertex painting to InOutvertexColor according to the given parameters
FColor PickVertexColorFromTextureData ( const uint8* MipData, const FVector2D& UVCoordinate, const UTexture2D* Texture, const FColor ColorMask ) Helper function to retrieve vertex color from a UTexture given a UVCoordinate
bool PropagateColorsToRawMesh ( UStaticMesh* StaticMesh, int32 LODIndex, FStaticMeshComponentLODInfo& Compo... ) Propagates per-instance vertex colors to the underlying Static Mesh for the given LOD Index
void RemoveComponentInstanceVertexColors ( UStaticMeshComponent* StaticMe... ) Removes vertex colors associated with the static mesh component
void RemoveInstanceVertexColors ( UObject* Obj ) Removes vertex colors associated with the object
bool RetrieveViewportPaintRays ( const FSceneView* View, FViewport* Viewport, FPrimitiveDrawInterface* PDI, TArray< FPaintRay >& OutPaintRays )  
void SetColorDataForLOD ( USkeletalMesh* SkeletalMesh, int32 LODIndex, const FColor FillColor, const FColor MaskColor ) Sets all vertex colors for a specific LOD level in the SkeletalMesh to FillColor
void SetInstanceColorDataForLOD ( UStaticMeshComponent* MeshComp..., int32 LODIndex, const FColor FillColor, const FColor MaskColor ) Sets the specific (LOD Index) per-instance vertex colors for the given StaticMeshComponent to a single Color value
void SetInstanceColorDataForLOD ( UStaticMeshComponent* MeshComp..., int32 LODIndex, const TArray< FColor >& Colors ) Sets the specific (LOD Index) per-instance vertex colors for the given StaticMeshComponent to the supplied Color array
void SetRealtimeViewport ( bool bRealtime ) Sets whether or not the level viewport should be real time rendered move or viewport as parameter?
void SetViewportColorMode ( EMeshPaintColorViewMode ColorViewMo..., FEditorViewportClient* Viewpor... ) Forces the Viewport Client to render using the given Viewport Color ViewMode
bool TryGetNumberOfLODs ( const UMeshComponent* MeshComp..., int32& OutNumLODs ) OutNumLODs is set to number of Mesh LODs for the given MeshComponent and returns true, or returns false of given mesh component has no valid LODs

Classes

Type Name Description
Public struct FPaintRay  

Ask questions and help your peers Developer Forums

Write your own tutorials or read those from others Learning Library