UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGeometryCollectionClusteringUtility Class Reference

#include <GeometryCollectionClusteringUtility.h>

Static Public Member Functions

static CHAOS_API int32 ClusterBonesUnderNewNode (FGeometryCollection *GeometryCollection, const int32 InsertAtIndex, const TArray< int32 > &SelectedBones, bool CalcNewLocalTransform, bool Validate=true)
 
static CHAOS_API int32 ClusterBonesUnderNewNodeWithParent (FGeometryCollection *GeometryCollection, const int32 ParentOfNewNode, const TArray< int32 > &SelectedBones, bool CalcNewLocalTransform, bool Validate=true)
 
static CHAOS_API void ClusterAllBonesUnderNewRoot (FGeometryCollection *GeometryCollection, FName RootName=NAME_None, bool bUpdateChildBoneNames=true)
 
static CHAOS_API void ClusterBonesUnderExistingNode (FGeometryCollection *GeometryCollection, const TArray< int32 > &SourceElements)
 
static CHAOS_API void ClusterBonesUnderExistingNode (FGeometryCollection *GeometryCollection, int32 MergeNode, const TArray< int32 > &SourceElements)
 
static CHAOS_API void ClusterBonesByContext (FGeometryCollection *GeometryCollection, int32 MergeNode, const TArray< int32 > &SourceElementsIn)
 
static CHAOS_API bool ContainsMultipleRootBones (FGeometryCollection *GeometryCollection)
 
static CHAOS_API void GetRootBones (const FGeometryCollection *GeometryCollection, TArray< int32 > &RootBonesOut)
 
static CHAOS_API bool IsARootBone (const FGeometryCollection *GeometryCollection, int32 InBone)
 
static CHAOS_API void GetClusteredBonesWithCommonParent (const FGeometryCollection *GeometryCollection, int32 SourceBone, TArray< int32 > &BonesOut)
 
static CHAOS_API void GetBonesToLevel (const FGeometryCollection *GeometryCollection, int32 Level, TArray< int32 > &BonesOut, bool bOnlyClusteredOrRigid=true, bool bSkipFiltered=true)
 
static CHAOS_API void GetChildBonesFromLevel (const FGeometryCollection *GeometryCollection, int32 SourceBone, int32 Level, TArray< int32 > &BonesOut)
 
static CHAOS_API void GetChildBonesAtLevel (const FGeometryCollection *GeometryCollection, int32 SourceBone, int32 Level, TArray< int32 > &BonesOut)
 
static CHAOS_API void RecursiveAddAllChildren (const TManagedArray< TSet< int32 > > &Children, int32 SourceBone, TArray< int32 > &BonesOut)
 
static CHAOS_API int32 GetParentOfBoneAtSpecifiedLevel (const FGeometryCollection *GeometryCollection, int32 SourceBone, int32 Level, bool bSkipFiltered=false)
 
static CHAOS_API void RecursivelyUpdateChildBoneNames (int32 BoneIndex, const TManagedArray< TSet< int32 > > &Children, TManagedArray< FString > &BoneNames, bool OverrideBoneNames=false)
 
static CHAOS_API void UpdateHierarchyLevelOfChildren (FGeometryCollection *GeometryCollection, int32 ParentElement)
 
static CHAOS_API void UpdateHierarchyLevelOfChildren (FManagedArrayCollection &InCollection, int32 ParentElement)
 
static CHAOS_API void CollapseLevelHierarchy (int8 Level, FGeometryCollection *GeometryCollection)
 
static CHAOS_API void CollapseSelectedHierarchy (int8 Level, const TArray< int32 > &SelectedBones, FGeometryCollection *GeometryCollection)
 
static CHAOS_API void ClusterBonesUnderExistingRoot (FGeometryCollection *GeometryCollection, const TArray< int32 > &SourceElements)
 
static CHAOS_API void CollapseHierarchyOneLevel (FGeometryCollection *GeometryCollection, TArray< int32 > &SourceElements)
 
static CHAOS_API bool NodeExistsOnThisBranch (const FGeometryCollection *GeometryCollection, int32 TestNode, int32 TreeElement)
 
static CHAOS_API void RenameBone (FGeometryCollection *GeometryCollection, int32 BoneIndex, const FString &NewName, bool UpdateChildren=true)
 
static CHAOS_API void GetLeafBones (const FManagedArrayCollection *GeometryCollection, int BoneIndex, bool bOnlyRigids, TArray< int32 > &LeafBonesOut)
 
static CHAOS_API void MoveUpOneHierarchyLevel (FGeometryCollection *GeometryCollection, const TArray< int32 > &SelectedBones)
 
static CHAOS_API int32 FindLowestCommonAncestor (const FManagedArrayCollection *GeometryCollection, const TArray< int32 > &SelectedBones)
 
static CHAOS_API bool RemoveDanglingClusters (FGeometryCollection *GeometryCollection)
 
static CHAOS_API bool RemoveClustersOfOnlyOneChild (FGeometryCollection *GeometryCollection)
 
static CHAOS_API void ValidateResults (FGeometryCollection *GeometryCollection)
 
static CHAOS_API int32 PickBestNodeToMergeTo (const FManagedArrayCollection *Collection, const TArray< int32 > &SourceElements)
 

Member Function Documentation

◆ ClusterAllBonesUnderNewRoot()

void FGeometryCollectionClusteringUtility::ClusterAllBonesUnderNewRoot ( FGeometryCollection GeometryCollection,
FName  RootName = NAME_None,
bool  bUpdateChildBoneNames = true 
)
static

Cluster all existing bones under a new root node, so there is now only one root node and a completely flat hierarchy underneath it

◆ ClusterBonesByContext()

void FGeometryCollectionClusteringUtility::ClusterBonesByContext ( FGeometryCollection GeometryCollection,
int32  MergeNode,
const TArray< int32 > &  SourceElementsIn 
)
static

Clusters using one of ClusterBonesUnderNewNode or ClusterBonesUnderExistingNode based on the context of what is being clustered

◆ ClusterBonesUnderExistingNode() [1/2]

void FGeometryCollectionClusteringUtility::ClusterBonesUnderExistingNode ( FGeometryCollection GeometryCollection,
const TArray< int32 > &  SourceElements 
)
static

Cluster all source bones under an existing node, algorithm chooses best node to add to 'closest to root'

◆ ClusterBonesUnderExistingNode() [2/2]

void FGeometryCollectionClusteringUtility::ClusterBonesUnderExistingNode ( FGeometryCollection GeometryCollection,
int32  MergeNode,
const TArray< int32 > &  SourceElements 
)
static

Cluster all source bones under an existing node, existing node is specifiedas MergeNode

◆ ClusterBonesUnderExistingRoot()

void FGeometryCollectionClusteringUtility::ClusterBonesUnderExistingRoot ( FGeometryCollection GeometryCollection,
const TArray< int32 > &  SourceElements 
)
static

reparent source bones under root bone

◆ ClusterBonesUnderNewNode()

int32 FGeometryCollectionClusteringUtility::ClusterBonesUnderNewNode ( FGeometryCollection GeometryCollection,
const int32  InsertAtIndex,
const TArray< int32 > &  SelectedBones,
bool  CalcNewLocalTransform,
bool  Validate = true 
)
static

Creates a cluster in the node hierarchy by re-parenting the Selected Bones off a new node in the hierarchy It makes more sense to think that the Selected Bones are all at the same level in the hierarchy however it will re-parent multiple levels at the InsertAtIndex location bone

e.g. if you have a flat chunk hierarchy after performing Voronoi fracturing L0 Root

|

| | | | L1 A B C D

Cluster A & B at insertion point A, results in L0 Root

|

| | | L1 E C D

|

| | L2 A B

Node E has no geometry of its own, only a transform by which to control A & B as a single unit

Returns
Index of the New Node

◆ ClusterBonesUnderNewNodeWithParent()

int32 FGeometryCollectionClusteringUtility::ClusterBonesUnderNewNodeWithParent ( FGeometryCollection GeometryCollection,
const int32  ParentOfNewNode,
const TArray< int32 > &  SelectedBones,
bool  CalcNewLocalTransform,
bool  Validate = true 
)
static

◆ CollapseHierarchyOneLevel()

void FGeometryCollectionClusteringUtility::CollapseHierarchyOneLevel ( FGeometryCollection GeometryCollection,
TArray< int32 > &  SourceElements 
)
static

moved the selected bones closer to the root

◆ CollapseLevelHierarchy()

void FGeometryCollectionClusteringUtility::CollapseLevelHierarchy ( int8  Level,
FGeometryCollection GeometryCollection 
)
static

Collapse hierarchy at specified level

◆ CollapseSelectedHierarchy()

void FGeometryCollectionClusteringUtility::CollapseSelectedHierarchy ( int8  Level,
const TArray< int32 > &  SelectedBones,
FGeometryCollection GeometryCollection 
)
static

Collapse hierarchy of selected bones at specified level

◆ ContainsMultipleRootBones()

bool FGeometryCollectionClusteringUtility::ContainsMultipleRootBones ( FGeometryCollection GeometryCollection)
static

Returns true if bone hierarchy contains more than one root node

◆ FindLowestCommonAncestor()

int32 FGeometryCollectionClusteringUtility::FindLowestCommonAncestor ( const FManagedArrayCollection GeometryCollection,
const TArray< int32 > &  SelectedBones 
)
static

Find the lowest common ancestor index of currently selected nodes. Returns INDEX_NODE if there is no common ancestor.

◆ GetBonesToLevel()

void FGeometryCollectionClusteringUtility::GetBonesToLevel ( const FGeometryCollection GeometryCollection,
int32  Level,
TArray< int32 > &  BonesOut,
bool  bOnlyClusteredOrRigid = true,
bool  bSkipFiltered = true 
)
static

Get list of all bones above the specified hierarchy level

◆ GetChildBonesAtLevel()

void FGeometryCollectionClusteringUtility::GetChildBonesAtLevel ( const FGeometryCollection GeometryCollection,
int32  SourceBone,
int32  Level,
TArray< int32 > &  BonesOut 
)
static

Get list of child bones down from the source bone at the specified hierarchy level

◆ GetChildBonesFromLevel()

void FGeometryCollectionClusteringUtility::GetChildBonesFromLevel ( const FGeometryCollection GeometryCollection,
int32  SourceBone,
int32  Level,
TArray< int32 > &  BonesOut 
)
static

Get list of child bones down from the source bone below the specified hierarchy level

◆ GetClusteredBonesWithCommonParent()

void FGeometryCollectionClusteringUtility::GetClusteredBonesWithCommonParent ( const FGeometryCollection GeometryCollection,
int32  SourceBone,
TArray< int32 > &  BonesOut 
)
static

Finds all Bones in same cluster as the one specified

◆ GetLeafBones()

void FGeometryCollectionClusteringUtility::GetLeafBones ( const FManagedArrayCollection GeometryCollection,
int  BoneIndex,
bool  bOnlyRigids,
TArray< int32 > &  LeafBonesOut 
)
static

return an array of all child leaf nodes below the specified node. If bOnlyRigids is true, the first Rigid node dound is considered a leaf, regardless of an children it might have.

◆ GetParentOfBoneAtSpecifiedLevel()

int32 FGeometryCollectionClusteringUtility::GetParentOfBoneAtSpecifiedLevel ( const FGeometryCollection GeometryCollection,
int32  SourceBone,
int32  Level,
bool  bSkipFiltered = false 
)
static

Search hierarchy for the parent of the specified bone, where the parent exists at the given level in the hierarchy. If bSkipFiltered, also skip to parents of any rigid/embedded nodes that will be filtered from the outliner.

◆ GetRootBones()

void FGeometryCollectionClusteringUtility::GetRootBones ( const FGeometryCollection GeometryCollection,
TArray< int32 > &  RootBonesOut 
)
static

Finds the root bone in the hierarchy, the one with an invalid parent bone index

◆ IsARootBone()

bool FGeometryCollectionClusteringUtility::IsARootBone ( const FGeometryCollection GeometryCollection,
int32  InBone 
)
static

Return true if the specified bone is a root bone

◆ MoveUpOneHierarchyLevel()

void FGeometryCollectionClusteringUtility::MoveUpOneHierarchyLevel ( FGeometryCollection GeometryCollection,
const TArray< int32 > &  SelectedBones 
)
static

move the selected node up a level in direction of root

◆ NodeExistsOnThisBranch()

bool FGeometryCollectionClusteringUtility::NodeExistsOnThisBranch ( const FGeometryCollection GeometryCollection,
int32  TestNode,
int32  TreeElement 
)
static

return true of Test Node exists on tree branch specified by TreeElement Node

◆ PickBestNodeToMergeTo()

int32 FGeometryCollectionClusteringUtility::PickBestNodeToMergeTo ( const FManagedArrayCollection Collection,
const TArray< int32 > &  SourceElements 
)
static

◆ RecursiveAddAllChildren()

void FGeometryCollectionClusteringUtility::RecursiveAddAllChildren ( const TManagedArray< TSet< int32 > > &  Children,
int32  SourceBone,
TArray< int32 > &  BonesOut 
)
static

Recursively Add all children to output bone list from source bone down to the leaf nodes

◆ RecursivelyUpdateChildBoneNames()

void FGeometryCollectionClusteringUtility::RecursivelyUpdateChildBoneNames ( int32  BoneIndex,
const TManagedArray< TSet< int32 > > &  Children,
TManagedArray< FString > &  BoneNames,
bool  OverrideBoneNames = false 
)
static

Maintains the bone naming convention of Root "Name" Level 1 "Name_001", "Name_0002", ... Level 2 children of "Name_0001" are "Name_0001_0001", "Name_0001_0002",.. etc from the given bone index down through the hierarchy to the leaf nodes

◆ RemoveClustersOfOnlyOneChild()

bool FGeometryCollectionClusteringUtility::RemoveClustersOfOnlyOneChild ( FGeometryCollection GeometryCollection)
static

Simplify the geometry collection by removing cluster nodes w/ a parent and only one child, re-parenting the child to its grand-parent. Returns true if any nodes were removed.

◆ RemoveDanglingClusters()

bool FGeometryCollectionClusteringUtility::RemoveDanglingClusters ( FGeometryCollection GeometryCollection)
static

Delete any cluster nodes discovered to have no children. Returns true if any nodes were removed.

◆ RenameBone()

void FGeometryCollectionClusteringUtility::RenameBone ( FGeometryCollection GeometryCollection,
int32  BoneIndex,
const FString &  NewName,
bool  UpdateChildren = true 
)
static

Rename a bone node, will automatically update all child node names if requested (current default)

◆ UpdateHierarchyLevelOfChildren() [1/2]

void FGeometryCollectionClusteringUtility::UpdateHierarchyLevelOfChildren ( FGeometryCollection GeometryCollection,
int32  ParentElement 
)
static

Recursively update the hierarchy level of all the children below this bone

◆ UpdateHierarchyLevelOfChildren() [2/2]

void FGeometryCollectionClusteringUtility::UpdateHierarchyLevelOfChildren ( FManagedArrayCollection InCollection,
int32  ParentElement 
)
static

◆ ValidateResults()

void FGeometryCollectionClusteringUtility::ValidateResults ( FGeometryCollection GeometryCollection)
static

The documentation for this class was generated from the following files: