Navigation
API > API/Plugins > API/Plugins/MeshModelingToolsEditorOnly
An interactive tool for painting and editing skin weights.
| Name | USkinWeightsPaintTool |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MeshModelingToolset/Source/MeshModelingToolsEditorOnly/Public/SkeletalMesh/SkinWeightsPaintTool.h |
| Include Path | #include "SkeletalMesh/SkinWeightsPaintTool.h" |
Syntax
UCLASS ()
class USkinWeightsPaintTool :
public UDynamicMeshBrushTool ,
public ISkeletalMeshEditingInterface
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveTool → USingleSelectionTool → UMeshSurfacePointTool → UBaseBrushTool → UDynamicMeshBrushTool → USkinWeightsPaintTool
Implements Interfaces
- IClickDragBehaviorTarget
- IModifierToggleBehaviorTarget
- IHoverBehaviorTarget
- IInputBehaviorSource
- IInteractiveToolCameraFocusAPI
- ISkeletalMeshEditingInterface
Derived Classes
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| DynamicTrianglesOctree | UE::Geometry::FDynamicMeshOctree3 | SkeletalMesh/SkinWeightsPaintTool.h | |
| DynamicVerticesOctree | UE::Geometry::TDynamicVerticesOctree3< FDynamicMesh3 > | Used to accelerate mesh queries | SkeletalMesh/SkinWeightsPaintTool.h |
| FOnSelectionChanged | TMulticastDelegate_NoParams< void > | Called whenever the selection is modified | SkeletalMesh/SkinWeightsPaintTool.h |
| FOnWeightsChanged | TMulticastDelegate_NoParams< void > | Called whenever the weights are modified | SkeletalMesh/SkinWeightsPaintTool.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CopyPasteWeightsIdentifier | const FString | SkeletalMesh/SkinWeightsPaintTool.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| OnSelectionChanged | FOnSelectionChanged | SkeletalMesh/SkinWeightsPaintTool.h | ||
| OnWeightsChanged | FOnWeightsChanged | SkeletalMesh/SkinWeightsPaintTool.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ApplyWeightEditsAsTransaction
(
const SkinPaintTool::FMultiBoneWeightEdits& WeightEdits, |
"One-off" Edits: For all one-and-done edits, you can call ApplyWeightEditsAsTransaction(). | SkeletalMesh/SkinWeightsPaintTool.h | |
void ApplyWeightEditsWithoutTransaction
(
const SkinPaintTool::FMultiBoneWeightEdits& WeightEdits |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void AverageWeights
(
const float Strength |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void BeginChange () |
HOW TO EDIT WEIGHTS WITH UNDO/REDO: | SkeletalMesh/SkinWeightsPaintTool.h | |
void ClampInfluences
(
const int32 MaxInfluences |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void CopyWeights() |
Copy paste | SkeletalMesh/SkinWeightsPaintTool.h | |
void EditWeightsOnVertices
(
BoneIndex Bone, |
Method to set weights directly (numeric input, for example) | SkeletalMesh/SkinWeightsPaintTool.h | |
void EndChange
(
const FText& TransactionLabel |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ExternalAddInfluenceToVertices
(
const BoneIndex InfluenceToAdd, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ExternalRemoveInfluenceFromVertices
(
const BoneIndex InfluenceToRemove, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ExternalUpdateSkinWeightLayer
(
const EMeshLODIdentifier InLOD, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ExternalUpdateWeights
(
const int32 BoneIndex, |
Using when ToolChange is applied via Undo/Redo | SkeletalMesh/SkinWeightsPaintTool.h | |
UWeightToolMeshSelector * GetActiveMeshSelector() |
Get access to the currently active mesh selector (may be on the transfer source mesh) | SkeletalMesh/SkinWeightsPaintTool.h | |
float GetAverageWeightOnBone
(
const BoneIndex InBoneIndex, |
Get the average weight value of a single bone on the given vertices | SkeletalMesh/SkinWeightsPaintTool.h | |
FName GetBoneNameFromIndex
(
BoneIndex InIndex |
Convert an index to a name | SkeletalMesh/SkinWeightsPaintTool.h | |
BoneIndex GetCurrentBoneIndex() |
Get the currently selected bone | SkeletalMesh/SkinWeightsPaintTool.h | |
FCleanedEditMesh * GetCurrentCleanedEditMesh() |
Get access to the mesh description for the mesh being edited | SkeletalMesh/SkinWeightsPaintTool.h | |
FDynamicMesh3 * GetCurrentlyEditedDynamicMesh() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
FMeshDescription * GetCurrentlyEditedMeshDescription() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
| Get the average weight value of each influence on the given vertices | SkeletalMesh/SkinWeightsPaintTool.h | ||
UWeightToolMeshSelector * GetMainMeshSelector() |
Get access to the mesh selector for the main mesh | SkeletalMesh/SkinWeightsPaintTool.h | |
UWeightToolSelectionIsolator * GetSelectionIsolator() |
Get access to the selection isolation system | SkeletalMesh/SkinWeightsPaintTool.h | |
UToolTargetManager * GetTargetManager() |
Get the target manager (cached from Setup) | SkeletalMesh/SkinWeightsPaintTool.h | |
void GetVerticesAffectedByBone
(
BoneIndex IndexOfBone, |
Get a list of vertices affected by the given bone | SkeletalMesh/SkinWeightsPaintTool.h | |
virtual FEditorViewportClient * GetViewportClient() |
Get the viewport this tool is operating in | SkeletalMesh/SkinWeightsPaintTool.h | |
SkinPaintTool::FSkinToolWeights & GetWeights() |
Allows outside systems to access the weight data | SkeletalMesh/SkinWeightsPaintTool.h | |
USkinWeightsPaintToolProperties * GetWeightToolProperties() |
Get the tool properties | SkeletalMesh/SkinWeightsPaintTool.h | |
UWeightToolTransferManager * GetWeightTransferManager() |
Get access to the weight tranfer system | SkeletalMesh/SkinWeightsPaintTool.h | |
void HammerWeights() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
bool HasActiveSelectionOnMainMesh() |
Does the main mesh have an active selection ("active" meaning the selection is currently being rendered in the view and is editable) | SkeletalMesh/SkinWeightsPaintTool.h | |
void Init
(
const FToolBuilderState& InSceneState |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void MirrorWeights
(
EAxis::Type Axis, |
Weight editing operations (selection based) | SkeletalMesh/SkinWeightsPaintTool.h | |
void NormalizeWeights() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void PasteWeights() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void PruneWeights
(
const float Threshold, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void SelectAffected() |
Select all vertices affected by the currently selected bone(s) | SkeletalMesh/SkinWeightsPaintTool.h | |
void SelectByInfluenceCount
(
const int32 MinInfluences |
Select all vertices affected by at least MinInfluences number of bones | SkeletalMesh/SkinWeightsPaintTool.h | |
void SetDisplayVertexColors
(
bool bShowVertexColors |
Toggle the display of weights on the preview mesh (if false, uses the normal skeletal mesh material) | SkeletalMesh/SkinWeightsPaintTool.h | |
void SetFocusInViewport() |
Set focus back to viewport so that hotkeys are immediately detected while hovering | SkeletalMesh/SkinWeightsPaintTool.h | |
void ToggleEditingMode() |
Toggle brush / selection mode | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateCurrentlyEditedMesh
(
const USkeletalMeshComponent* Component, |
Call this whenever the target mesh is modified | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateSelectorState() |
Update the state of the mesh selectors | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UBaseBrushTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual double EstimateMaximumTargetDimension() |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UMeshSurfacePointTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool HitTest
(
const FRay& Ray, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void OnBeginDrag
(
const FRay& Ray |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void OnEndDrag
(
const FRay& Ray |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void OnUpdateDrag
(
const FRay& Ray |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UInteractiveTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool CanAccept() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void DrawHUD
(
FCanvas* Canvas, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual bool HasAccept() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual bool HasCancel() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void Render
(
IToolsContextRenderAPI* RenderAPI |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void Setup() |
UInteractiveTool. | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IInteractiveToolCameraFocusAPI
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBox GetWorldSpaceFocusBox() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual bool SupportsWorldSpaceFocusBox() |
IInteractiveToolCameraFocusAPI. | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IClickDragBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FInputRayHit CanBeginClickDragSequence
(
const FInputDeviceRay& InPressPos |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IModifierToggleBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnUpdateModifierState
(
int ModifierID, |
IClickDragBehaviorTarget implementation. | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IHoverBehaviorTarget
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool OnUpdateHover
(
const FInputDeviceRay& DevicePos |
SkeletalMesh/SkinWeightsPaintTool.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ApplyStamp
(
const FBrushStampData& Stamp |
SkeletalMesh/SkinWeightsPaintTool.h | ||
float CalculateBrushFalloff
(
float Distance |
Stamp | SkeletalMesh/SkinWeightsPaintTool.h | |
float CalculateBrushStrengthToUse
(
EWeightEditOperation EditMode |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void CalculateVertexROI
(
const FBrushStampData& InStamp, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void CreateWeightEditsForVertices
(
EWeightEditOperation EditOperation, |
Generating bone weight edits to be stored in a transaction does not actually change the weight buffers | SkeletalMesh/SkinWeightsPaintTool.h | |
void CreateWeightEditsToRelaxVertices
(
TArray< int32 > VerticesToEdit, |
Same as CreateWeightEditsForVertices() but specific to relaxation (topology aware operation) | SkeletalMesh/SkinWeightsPaintTool.h | |
BoneIndex GetBoneIndexFromName
(
const FName BoneName |
SkeletalMesh/SkinWeightsPaintTool.h | ||
FVector4f GetColorOfVertex
(
VertexIndex InVertexIndex, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void InitializeOctrees() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void InitializeSmoothWeightsOperator() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
bool IsProfileValid
(
const FName InProfileName |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void OnActiveLODChanged() |
Skin weight layer | SkeletalMesh/SkinWeightsPaintTool.h | |
void OnActiveSkinWeightProfileChanged() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void OnNewSkinWeightProfileChanged() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void UpdateCurrentBone
(
const FName& BoneName |
Which bone are we currently painting? | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateVertexColorForAllVertices() |
Vertex colors updated when switching current bone or initializing whole mesh | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateVertexColorForSubsetOfVertices() |
Vertex colors updated when make sparse edits to subset of vertices | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UDynamicMeshBrushTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void OnShutdown
(
EToolShutdownType ShutdownType |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UInteractiveTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| SkeletalMesh/SkinWeightsPaintTool.h | |||
virtual void OnTick
(
float DeltaTime |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from ISkeletalMeshEditingInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void HandleSkeletalMeshModified
(
const TArray< FName >& InBoneNames, |
SkeletalMesh/SkinWeightsPaintTool.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Sum all the weights on all bones for a given list of vertices (results we not be normalized!) | SkeletalMesh/SkinWeightsPaintTool.h | ||
static void NormalizeWeightMap
(
TMap< BoneIndex, float >& InOutWeights |
Given a map of BoneIndex > Weight values for a single vertex, modify the weights to sum to 1 | SkeletalMesh/SkinWeightsPaintTool.h | |
static void TruncateWeightMap
(
TMap< BoneIndex, float >& InOutWeights |
HELPER functions for modifying weights | SkeletalMesh/SkinWeightsPaintTool.h |