Navigation
API > API/Plugins > API/Plugins/MeshModelingToolsEditorOnlyExp > API/Plugins/MeshModelingToolsEditorOnlyExp/SkeletalMesh
Inheritance Hierarchy
- UObject
- IInputBehaviorSource
- UInteractiveTool
- USingleSelectionTool
- UMeshSurfacePointTool
- UBaseBrushTool
- UDynamicMeshBrushTool
- USkinWeightsPaintTool
References
| Module | MeshModelingToolsEditorOnlyExp |
| Header | /Engine/Plugins/Experimental/MeshModelingToolsetExp/Source/MeshModelingToolsEditorOnlyExp/Public/SkeletalMesh/SkinWeightsPaintTool.h |
| Include | #include "SkeletalMesh/SkinWeightsPaintTool.h" |
Syntax
UCLASS ()
class USkinWeightsPaintTool :
public UDynamicMeshBrushTool ,
public ISkeletalMeshEditingInterface
Remarks
An interactive tool for painting and editing skin weights.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TUniquePtr< SkinPaintTool::FMeshSkinWeightsChange > | ActiveChange | Storage for weight edits in the current transaction | |
| bool | bBoneColorsToRestore | ||
| bool | bInvertStroke | ||
| bool | bStampPending | ||
| bool | bVertexColorsNeedUpdated | ||
| FName | CurrentBone | ||
| EMeshLODIdentifier | CurrentlyEditedLOD | ||
| TMap< EMeshLODIdentifier, FCleanedEditMesh > | EditedMeshes | The currently edited mesh descriptions | |
| TWeakObjectPtr< USkeletalMeshEditorContextObjectBase > | EditorContext | Global properties stored on initialization | |
| FBrushStampData | LastStamp | ||
| TObjectPtr< UWeightToolMeshSelector > | MeshSelector | The selection system for the main mesh | |
| SkinPaintTool::FSkinMirrorData | MirrorData | Cached mirror data | |
| FOnSelectionChanged | OnSelectionChanged | ||
| FOnWeightsChanged | OnWeightsChanged | ||
| TOptional< FName > | PendingCurrentBone | ||
| TWeakObjectPtr< UPersonaEditorModeManagerContext > | PersonaModeManagerContext | ||
| FString | PreviewProfileToRestore | Editor state to restore when exiting the paint tool | |
| TArray< BoneIndex > | SelectedBoneIndices | ||
| TArray< FName > | SelectedBoneNames | ||
| TObjectPtr< UWeightToolSelectionIsolator > | SelectionIsolator | Manages isolating a selection of the mesh | |
| TUniquePtr< UE::Geometry::TBoneWeightsDataSource< int32, float > > | SmoothWeightsDataSource | Smooth weights data source and operator. | |
| TUniquePtr< UE::Geometry::TSmoothBoneWeights< int32, float > > | SmoothWeightsOp | ||
| FVector | StampLocalPos | ||
| FBrushStampData | StartStamp | ||
| TWeakObjectPtr< UToolTargetManager > | TargetManager | ||
| TObjectPtr< UWeightToolTransferManager > | TransferManager | Manages transferring skin weights from a separate mesh | |
| TFuture< void > | TriangleOctreeFuture | ||
| TUniquePtr< DynamicTrianglesOctree > | TrianglesOctree | ||
| TArray< int32 > | TrianglesToReinsert | ||
| int32 | TriangleUnderStamp | ||
| TUniquePtr< DynamicVerticesOctree > | VerticesOctree | ||
| TSet< int32 > | VerticesToUpdateColor | ||
| SkinPaintTool::FSkinToolWeights | Weights | Storage of vertex weights per bone | |
| TObjectPtr< USkinWeightsPaintToolProperties > | WeightToolProperties | Tool properties |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AccumulateWeights
(
const TArray< SkinPaintTool::VertexWeights >& AllWeights, |
Sum all the weights on all bones for a given list of vertices (results we not be normalized!) | |
| void | ApplyStamp
(
const FBrushStampData& Stamp |
||
| void | ApplyWeightEditsAsTransaction
(
const SkinPaintTool::FMultiBoneWeightEdits& WeightEdits, |
"One-off" Edits: For all one-and-done edits, you can call ApplyWeightEditsAsTransaction(). | |
| void | ApplyWeightEditsWithoutTransaction
(
const SkinPaintTool::FMultiBoneWeightEdits& WeightEdits |
||
| void | AverageWeights
(
const float Strength |
||
| void | BeginChange () |
HOW TO EDIT WEIGHTS WITH UNDO/REDO: | |
| float | CalculateBrushFalloff
(
float Distance |
Stamp | |
| float | CalculateBrushStrengthToUse
(
EWeightEditOperation EditMode |
||
| void | CalculateVertexROI
(
const FBrushStampData& InStamp, |
||
| void | CopyWeights () |
Copy paste | |
| void | CreateWeightEditsForVertices
(
EWeightEditOperation EditOperation, |
Generating bone weight edits to be stored in a transaction does not actually change the weight buffers | |
| void | CreateWeightEditsToRelaxVertices
(
TArray< int32 > VerticesToEdit, |
Same as CreateWeightEditsForVertices() but specific to relaxation (topology aware operation) | |
| void | EditWeightsOnVertices
(
BoneIndex Bone, |
Method to set weights directly (numeric input, for example) | |
| void | |||
| void | ExternalAddInfluenceToVertices
(
const BoneIndex InfluenceToAdd, |
||
| void | ExternalRemoveInfluenceFromVertices
(
const BoneIndex InfluenceToRemove, |
||
| void | ExternalUpdateSkinWeightLayer
(
const EMeshLODIdentifier InLOD, |
||
| void | ExternalUpdateWeights
(
const int32 BoneIndex, |
Using when ToolChange is applied via Undo/Redo | |
| UWeightToolMeshSelector * | Get access to the currently active mesh selector (may be on the transfer source mesh) | ||
| float | GetAverageWeightOnBone
(
const BoneIndex InBoneIndex, |
Get the average weight value of a single bone on the given vertices | |
| BoneIndex | GetBoneIndexFromName
(
const FName BoneName |
||
| FName | GetBoneNameFromIndex
(
BoneIndex InIndex |
Convert an index to a name | |
| FVector4f | GetColorOfVertex
(
VertexIndex InVertexIndex, |
||
| BoneIndex | Get the currently selected bone | ||
| FCleanedEditMesh * | Get access to the mesh description for the mesh being edited | ||
| FDynamicMesh3 * | |||
| FMeshDescription * | |||
| void | GetInfluences
(
const TArray< int32 >& VertexIndices, |
Get the average weight value of each influence on the given vertices | |
| UWeightToolMeshSelector * | Get access to the mesh selector for the main mesh | ||
| UWeightToolSelectionIsolator * | Get access to the selection isolation system | ||
| UToolTargetManager * | Get the target manager (cached from Setup) | ||
| void | GetVerticesAffectedByBone
(
BoneIndex IndexOfBone, |
Get a list of vertices affected by the given bone | |
| FEditorViewportClient * | Get the viewport this tool is operating in | ||
| SkinPaintTool::FSkinToolWeights & | GetWeights () |
Allows outside systems to access the weight data | |
| USkinWeightsPaintToolProperties * | Get the tool properties | ||
| UWeightToolTransferManager * | Get access to the weight tranfer system | ||
| void | |||
| bool | Does the main mesh have an active selection ("active" meaning the selection is currently being rendered in the view and is editable) | ||
| void | Init
(
const FToolBuilderState& InSceneState |
||
| void | |||
| void | |||
| bool | IsProfileValid
(
const FName InProfileName |
||
| void | MirrorWeights
(
EAxis::Type Axis, |
Weight editing operations (selection based) | |
| void | NormalizeWeightMap
(
TMap< BoneIndex, float >& InOutWeights |
Given a map of BoneIndex > Weight values for a single vertex, modify the weights to sum to 1 | |
| void | |||
| void | Skin weight layer | ||
| void | |||
| void | |||
| void | PasteWeights () |
||
| void | PruneWeights
(
const float Threshold, |
||
| void | Select all vertices affected by the currently selected bone(s) | ||
| void | SetDisplayVertexColors
(
bool bShowVertexColors |
Toggle the display of weights on the preview mesh (if false, uses the normal skeletal mesh material) | |
| void | Set focus back to viewport so that hotkeys are immediately detected while hovering | ||
| void | Toggle brush / selection mode | ||
| void | TruncateWeightMap
(
TMap< BoneIndex, float >& InOutWeights |
HELPER functions for modifying weights | |
| void | UpdateCurrentBone
(
const FName& BoneName |
Which bone are we currently painting? | |
| void | UpdateCurrentlyEditedMesh
(
const USkeletalMeshComponent* Component, |
Call this whenever the target mesh is modified | |
| void | Update the state of the mesh selectors | ||
| void | Vertex colors updated when switching current bone or initializing whole mesh | ||
| void | Vertex colors updated when make sparse edits to subset of vertices |
Overridden from UDynamicMeshBrushTool
| Type | Name | Description | |
|---|---|---|---|
| void | OnShutdown
(
EToolShutdownType ShutdownType |
Subclasses can override these to customize behavior |
Overridden from UBaseBrushTool
| Type | Name | Description | |
|---|---|---|---|
| double | Subclasses should implement this to give an estimate of target dimension for brush size scaling |
Overridden from UMeshSurfacePointTool
| Type | Name | Description | |
|---|---|---|---|
| bool | HitTest
(
const FRay& Ray, |
||
| void | OnBeginDrag
(
const FRay& Ray |
UMeshSurfacePointTool implementation. | |
| void | This function is called when the user releases the button driving a click-drag-release interaction | ||
| void | OnUpdateDrag
(
const FRay& Ray |
This function is called each frame that the user is in a click-drag-release interaction |
Overridden from UInteractiveTool
| Type | Name | Description | |
|---|---|---|---|
| bool | CanAccept () |
||
| void | DrawHUD
(
FCanvas* Canvas, |
Allow the Tool to do any custom screen space drawing | |
| bool | HasAccept () |
||
| bool | HasCancel () |
||
| void | OnPropertyModified
(
UObject* ModifiedObject, |
Automatically called by UInteractiveToolPropertySet.OnModified delegate to notify Tool of child property set changes | |
| void | OnTick
(
float DeltaTime |
Allow the Tool to do any necessary processing on Tick | |
| void | Render
(
IToolsContextRenderAPI* RenderAPI |
Allow the Tool to do any custom drawing (ie via PDI/RHI) | |
| void | Setup () |
UInteractiveTool. |
Overridden from IInteractiveToolCameraFocusAPI
| Type | Name | Description | |
|---|---|---|---|
| FBox | |||
| bool | IInteractiveToolCameraFocusAPI. |
Overridden from IClickDragBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| FInputRayHit | CanBeginClickDragSequence
(
const FInputDeviceRay& InPressPos |
IClickDragBehaviorTarget implementation. |
Overridden from IModifierToggleBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| void | OnUpdateModifierState
(
int ModifierID, |
IClickDragBehaviorTarget implementation. |
Overridden from IHoverBehaviorTarget
| Type | Name | Description | |
|---|---|---|---|
| bool | OnUpdateHover
(
const FInputDeviceRay& DevicePos |
Update active hover sequence with new input position |
Overridden from ISkeletalMeshEditingInterface
| Type | Name | Description | |
|---|---|---|---|
| void | HandleSkeletalMeshModified
(
const TArray< FName >& InBoneNames, |
Typedefs
| Name | Description |
|---|---|
| DynamicTrianglesOctree | |
| DynamicVerticesOctree | Used to accelerate mesh queries |
| FOnSelectionChanged | Called whenever the selection is modified |
| FOnWeightsChanged | Called whenever the weights are modified |
Constants
| Name | Description |
|---|---|
| CopyPasteWeightsIdentifier |