UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SkeletalDebugRendering Namespace Reference

Functions

void DrawWireBone (FPrimitiveDrawInterface *PDI, const FVector &InStart, const FVector &InEnd, const FLinearColor &InColor, ESceneDepthPriorityGroup InDepthPriority, const float SphereRadius)
 
void DrawWireBoneAdvanced (FPrimitiveDrawInterface *PDI, const FTransform &InBoneTransform, const TArray< FVector > &InChildLocations, const TArray< FLinearColor > &InChildColors, const FLinearColor &InColor, ESceneDepthPriorityGroup InDepthPriority, const float SphereRadius, const FBoneAxisDrawConfig &InAxisConfig)
 
void DrawAxes (FPrimitiveDrawInterface *PDI, const FTransform &Transform, ESceneDepthPriorityGroup InDepthPriority, const float Thickness, const float AxisLength)
 
void DrawConeConnection (FPrimitiveDrawInterface *PDI, const FVector &Start, const FVector &End, const float SphereRadius, const FLinearColor &Color)
 
void DrawBones (FPrimitiveDrawInterface *PDI, const FVector &ComponentOrigin, const TArray< FBoneIndexType > &RequiredBones, const FReferenceSkeleton &RefSkeleton, const TArray< FTransform > &WorldTransforms, const TArray< int32 > &InSelectedBones, const TArray< FLinearColor > &BoneColors, const TArray< TRefCountPtr< HHitProxy > > &HitProxies, const FSkelDebugDrawConfig &DrawConfig)
 
void DrawBones (FPrimitiveDrawInterface *PDI, const FVector &ComponentOrigin, const TArray< FBoneIndexType > &RequiredBones, const FReferenceSkeleton &RefSkeleton, const TArray< FTransform > &WorldTransforms, const TArray< int32 > &InSelectedBones, const TArray< FLinearColor > &BoneColors, const TArray< TRefCountPtr< HHitProxy > > &HitProxies, const FSkelDebugDrawConfig &DrawConfig, const TBitArray<> &BonesToDrawOverride)
 
void DrawBonesInternal (FPrimitiveDrawInterface *PDI, const FVector &ComponentOrigin, const TArray< FBoneIndexType > &RequiredBones, const TArray< int32 > &ParentIndices, const TArray< FTransform > &WorldTransforms, const TArray< int32 > &InSelectedBones, const TArray< FLinearColor > &BoneColors, const TArray< TRefCountPtr< HHitProxy > > &HitProxies, const FSkelDebugDrawConfig &DrawConfig, const TBitArray<> &BonesToDrawOverride)
 
FLinearColor GetSemiRandomColorForBone (const int32 BoneIndex, float Value, float Saturation)
 
void FillWithMultiColors (TArray< FLinearColor > &BoneColors, const int32 NumBones)
 
void CalculateBonesToDraw (const TArray< int32 > &ParentIndices, const TArray< int32 > &InSelectedBones, const EBoneDrawMode::Type BoneDrawMode, TBitArray<> &OutBonesToDraw)
 

Function Documentation

◆ CalculateBonesToDraw()

ENGINE_API void SkeletalDebugRendering::CalculateBonesToDraw ( const TArray< int32 > &  ParentIndices,
const TArray< int32 > &  InSelectedBones,
const EBoneDrawMode::Type  BoneDrawMode,
TBitArray<> &  OutBonesToDraw 
)

◆ DrawAxes()

ENGINE_API void SkeletalDebugRendering::DrawAxes ( FPrimitiveDrawInterface PDI,
const FTransform InTransform,
ESceneDepthPriorityGroup  InDepthPriority,
const float  Thickness = 0.f,
const float  AxisLength = 4.f 
)

Draw a set of axes to represent a transform

Parameters
PDIPrimitive draw interface to use
InTransformThe transform to represent
InDepthPriorityThe scene depth priority group to use
ThicknessThickness of Axes
AxisLengthAxisLength

◆ DrawBones() [1/2]

ENGINE_API void SkeletalDebugRendering::DrawBones ( FPrimitiveDrawInterface PDI,
const FVector ComponentOrigin,
const TArray< FBoneIndexType > &  RequiredBones,
const FReferenceSkeleton RefSkeleton,
const TArray< FTransform > &  WorldTransforms,
const TArray< int32 > &  InSelectedBones,
const TArray< FLinearColor > &  BoneColors,
const TArray< TRefCountPtr< HHitProxy > > &  HitProxies,
const FSkelDebugDrawConfig DrawConfig 
)

◆ DrawBones() [2/2]

ENGINE_API void SkeletalDebugRendering::DrawBones ( FPrimitiveDrawInterface PDI,
const FVector ComponentOrigin,
const TArray< FBoneIndexType > &  RequiredBones,
const FReferenceSkeleton RefSkeleton,
const TArray< FTransform > &  WorldTransforms,
const TArray< int32 > &  InSelectedBones,
const TArray< FLinearColor > &  BoneColors,
const TArray< TRefCountPtr< HHitProxy > > &  HitProxies,
const FSkelDebugDrawConfig DrawConfig,
const TBitArray<> &  BonesToDrawOverride 
)

◆ DrawBonesInternal()

void SkeletalDebugRendering::DrawBonesInternal ( FPrimitiveDrawInterface PDI,
const FVector ComponentOrigin,
const TArray< FBoneIndexType > &  RequiredBones,
const TArray< int32 > &  ParentIndices,
const TArray< FTransform > &  WorldTransforms,
const TArray< int32 > &  InSelectedBones,
const TArray< FLinearColor > &  BoneColors,
const TArray< TRefCountPtr< HHitProxy > > &  HitProxies,
const FSkelDebugDrawConfig DrawConfig,
const TBitArray<> &  BonesToDrawOverride 
)

◆ DrawConeConnection()

ENGINE_API void SkeletalDebugRendering::DrawConeConnection ( FPrimitiveDrawInterface PDI,
const FVector Start,
const FVector End,
const float  SphereRadius,
const FLinearColor Color 
)

Draw a cone showing offset from origin position to a given bone transform Used to draw the root cone (always in red)

Parameters
PDIPrimitive draw interface to use
StartThe position in world space of the start of the cone
EndThe position in world space of the tapered end of the cone
SphereRadiusThe radius of the root bone
ColorThe color to use for the cone

◆ DrawWireBone()

ENGINE_API void SkeletalDebugRendering::DrawWireBone ( FPrimitiveDrawInterface PDI,
const FVector InStart,
const FVector InEnd,
const FLinearColor InColor,
ESceneDepthPriorityGroup  InDepthPriority,
const float  SphereRadius 
)

A fast and simple bone drawing function. This draws a sphere and a pyramid connection to the PARENT bone. Use this for basic debug drawing, but if the user is able to select or edit the bones, prefer DrawWireBoneAdvanced.

Draw a wireframe bone from InStart to InEnd

Parameters
PDIPrimitive draw interface to use
InStartThe start location of the bone
InEndThe end location of the bone
InColorThe color to draw the bone with
InDepthPriorityThe scene depth priority group to use
SphereRadiusSphereRadius

◆ DrawWireBoneAdvanced()

ENGINE_API void SkeletalDebugRendering::DrawWireBoneAdvanced ( FPrimitiveDrawInterface PDI,
const FTransform InBoneTransform,
const TArray< FVector > &  InChildLocations,
const TArray< FLinearColor > &  InChildColors,
const FLinearColor InColor,
ESceneDepthPriorityGroup  InDepthPriority,
const float  SphereRadius,
const FBoneAxisDrawConfig InAxisConfig 
)

An advanced bone drawing function for use with interactive editors where the user can select and manipulate bones.

Differences from DrawWireBone() include:

  1. Drawing all cone-connections to children as part of the "bone" itself so that the user can select the bone by clicking on any of it's children connections (as in all DCC applications)
  2. Cone-connectors are drawn between spheres, not overlapping them (cleaner)
  3. Bone sphere is oriented with bone rotation.
  4. Connections to children can be colored individually to allow highlighting parent connections on selected children.

This function, and the code required to structure the drawing in this manner, will incur some additional cost over DrawWireBone(). So in cases where you just want to debug draw a skeleton; with no option to select or manipulate the bones, it may be preferable to use DrawWireBone().

Draw a set of axes to represent a transform

Parameters
PDIPrimitive draw interface to use
InBoneTransformThe bone transform
InChildLocationsThe positions of all the children of the bone
InChildColorsThe colors to use when drawing the cone to each child
InColorThe color to use for the bone
InDepthPriorityThe scene depth priority group to use
SphereRadiusRadius of the ball drawn at the bone location
InAxisConfigDraw configuration for small coordinate axes inside the joint sphere

◆ FillWithMultiColors()

ENGINE_API void SkeletalDebugRendering::FillWithMultiColors ( TArray< FLinearColor > &  BoneColors,
const int32  NumBones 
)

◆ GetSemiRandomColorForBone()

ENGINE_API FLinearColor SkeletalDebugRendering::GetSemiRandomColorForBone ( const int32  BoneIndex,
float  Value,
float  Saturation 
)