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 (MinimalAPI)
class USkinWeightsPaintTool :
public UDynamicMeshBrushTool ,
public ISkeletalMeshEditingInterface ,
public ISkeletalMeshGeometryIsolationAwareTool ,
public IInteractiveToolManageGeometrySelectionAPI ,
public IHotkeyHintProvider
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UInteractiveTool → USingleSelectionTool → UMeshSurfacePointTool → UBaseBrushTool → UDynamicMeshBrushTool → USkinWeightsPaintTool
Implements Interfaces
- IClickDragBehaviorTarget
- IModifierToggleBehaviorTarget
- IHoverBehaviorTarget
- IInputBehaviorSource
- IInteractiveToolCameraFocusAPI
- IHotkeyHintProvider
- IInterface
- IInteractiveToolManageGeometrySelectionAPI
- ISkeletalMeshGeometryIsolationAwareTool
- ISkeletalMeshEditingInterface
Structs
| Name | Remarks |
|---|---|
| FScopedSuspendIsolation | Need to reisolate the mesh if making structural changes to the edited mesh submesh needs to be recreated |
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 |
|---|---|---|---|
| ActionCommandsContextName | const TCHAR * | SkeletalMesh/SkinWeightsPaintTool.h | |
| 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 ExternalUpdateSkinWeightLayer
(
const FName InSkinWeightProfile |
Switches active skin profile during undo/redo replay. | SkeletalMesh/SkinWeightsPaintTool.h | |
UToolMeshSelector * GetActiveMeshSelector() |
Get access to the currently active mesh selector (may be on the transfer source mesh) | SkeletalMesh/SkinWeightsPaintTool.h | |
FName GetActiveSkinWeightProfileName() |
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 | |
const TArray< int32 > & GetDefaultIsolationTriangles () |
Returns default isolation triangles from the editor context (empty if none). | SkeletalMesh/SkinWeightsPaintTool.h | |
const TSet< int32 > & GetFinalLockedBoneIndices() |
Get the set of bones whose weights are actually locked, taking into account bBypassAllLocks | SkeletalMesh/SkinWeightsPaintTool.h | |
| Get the average weight value of each influence on the given vertices | SkeletalMesh/SkinWeightsPaintTool.h | ||
UToolMeshSelector * GetMainMeshSelector() |
Get access to the mesh selector for the main mesh | SkeletalMesh/SkinWeightsPaintTool.h | |
FDynamicMesh3 & GetMesh() |
Get access to the mesh being edited | SkeletalMesh/SkinWeightsPaintTool.h | |
UMeshElementsVisualizer * GetMeshElementsDisplay() |
Get access to the mesh-element visualizer (used for polygroup-boundary edge rendering) | SkeletalMesh/SkinWeightsPaintTool.h | |
const TSet< int32 > & GetRawLockedBoneIndices() |
Get the set of bones whose weights are locked by user, does not consider bBypassAllLocks | 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 | |
const TSharedPtr< SReferenceSkeletonTree > & GetToolSkeletonTree() |
Returns the skeleton tree displayed when using this tool | SkeletalMesh/SkinWeightsPaintTool.h | |
void GetVerticesAffectedByBone
(
BoneIndex IndexOfBone, |
Get a list of vertices affected by the given bone | 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 | ||
bool IsBypassingAllLocks() |
Whether weight edits should respect locks or not | 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 SetTargetManager
(
UToolTargetManager* InTargetManager |
Set the target manager. | SkeletalMesh/SkinWeightsPaintTool.h | |
bool ShouldProceedWithAllBonesUnlocked() |
Certain operations do not support bone locking yet, show a dialog to check if user still want to proceed. | SkeletalMesh/SkinWeightsPaintTool.h | |
void ToggleEditingMode() |
Toggle brush / selection mode | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateBrushIndicators() |
Update the brush indicators visibility state. | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateCurrentlyEditedMesh
(
const FDynamicMesh3& InDynamicMesh |
Call this whenever the target mesh is modified | SkeletalMesh/SkinWeightsPaintTool.h | |
void UpdateSelectorState() |
Update the state of the mesh selectors | SkeletalMesh/SkinWeightsPaintTool.h |
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const TArray< FTransform > & GetComponentSpaceBoneTransforms() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual EMeshLODIdentifier GetEditingLOD() |
Derived tools can optionally override these if they are invoked in editors that don't offer skeletal mesh editor context object. | SkeletalMesh/SkinWeightsPaintTool.h | |
virtual FEditorViewportClient * GetViewportClient() |
Get the viewport this tool is operating in | SkeletalMesh/SkinWeightsPaintTool.h | |
virtual void ToggleBoneManipulation
(
bool bEnable |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from UBaseBrushTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual double EstimateMaximumTargetDimension() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void SetupBrushStampIndicator() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void ShutdownBrushStampIndicator() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual void UpdateBrushStampIndicator() |
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 |
Overridden from ISkeletalMeshGeometryIsolationAwareTool
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsInputIsolationValidOnOutput() |
ISkeletalMeshGeometryIsolationAwareTool. | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IInteractiveToolManageGeometrySelectionAPI
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsInputSelectionValidOnOutput() |
IInteractiveToolManageGeometrySelectionAPI. | SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from IHotkeyHintProvider
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void GetHotkeyHints
(
TArray< FHotkeyHint >& OutHints |
IHotkeyHintProvider. | SkeletalMesh/SkinWeightsPaintTool.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
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, |
Single smoothing pass. | SkeletalMesh/SkinWeightsPaintTool.h | |
BoneIndex GetBoneIndexFromName
(
const FName BoneName |
SkeletalMesh/SkinWeightsPaintTool.h | ||
FVector4f GetColorOfVertex
(
VertexIndex InVertexIndex, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
| SkeletalMesh/SkinWeightsPaintTool.h | |||
bool HasSelectedBone() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void InitializeOctrees() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void InitializeSmoothWeightsOperator
(
const FDynamicMesh3& RestPoseMesh |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void IsolateSelectedBones() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
bool IsProfileValid
(
const FName InProfileName |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void OnActiveSkinWeightProfileChanged() |
Skin weight layer | SkeletalMesh/SkinWeightsPaintTool.h | |
void OnLinearColorRampChanged
(
TArray< FRichCurve* > ChangedCurves |
Called when linear color ramp curves changed | SkeletalMesh/SkinWeightsPaintTool.h | |
void OnNewSkinWeightProfileChanged() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void SetLockAllBones
(
bool bLock |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void SetLockBone
(
BoneIndex InBoneIndex, |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void SetLockSelectedBones
(
bool bLock |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ToggleBypassLocks() |
SkeletalMesh/SkinWeightsPaintTool.h | ||
void ToggleSelectedBonesLockState() |
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() |
Per-tick gate for vertex-color refresh. OnTick consumes and Clear()s. | SkeletalMesh/SkinWeightsPaintTool.h |
Protected Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void ApplyStamp
(
const FBrushStampData& Stamp |
SkeletalMesh/SkinWeightsPaintTool.h | ||
virtual TSharedRef< SWidget > OnGetLockWidget
(
FName BoneName |
Skin weight locking | 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 | ||
virtual void RegisterActions
(
FInteractiveToolActionSet& ActionSet |
SkeletalMesh/SkinWeightsPaintTool.h |
Overridden from ISkeletalMeshEditingInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedPtr< SWidget > GetCustomSkeletonTreeWidget
(
TSharedPtr< ISkeletalMeshEditorBinding > EditorBinding |
SkeletalMesh/SkinWeightsPaintTool.h | ||
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 are not normalized!) | SkeletalMesh/SkinWeightsPaintTool.h | ||
static void GetLockedWeight
(
const TArray< SkinPaintTool::VertexWeights >& AllWeights, |
Query information about how weights are locked on a specific vertex | 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 ExpectedSum | SkeletalMesh/SkinWeightsPaintTool.h | |
static void TruncateWeightMap
(
TMap< BoneIndex, float >& InOutWeights, |
HELPER functions for modifying weights | SkeletalMesh/SkinWeightsPaintTool.h |