a.Skeleton.AllowIncompatibleSkeletalMeshMerge
a.Skeleton.AllowIncompatibleSkeletalMeshMerge
#Overview
name: a.Skeleton.AllowIncompatibleSkeletalMeshMerge
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
When importing or otherwise merging in skeletal mesh bones, allow \'incompatible\' hierarchies with bone insertions.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.Skeleton.AllowIncompatibleSkeletalMeshMerge is to control whether incompatible skeletal mesh hierarchies with bone insertions are allowed during the process of importing or merging skeletal mesh bones.
This setting variable is primarily used in the Animation system of Unreal Engine, specifically within the Skeleton and SkeletalMesh subsystems. It is referenced in the Engine module, particularly in the Animation component.
The value of this variable is set using a console variable (CVarAllowIncompatibleSkeletalMeshMerge) with a default value of 0 (false). This means that by default, incompatible skeletal mesh merges are not allowed.
The associated variable CVarAllowIncompatibleSkeletalMeshMerge directly interacts with a.Skeleton.AllowIncompatibleSkeletalMeshMerge. They share the same value and purpose.
Developers must be aware that enabling this variable (setting it to true) can potentially lead to issues in skeletal hierarchies and animations. It should be used cautiously and only when necessary, such as when dealing with legacy content or specific asset pipelines that require merging incompatible skeletal meshes.
Best practices when using this variable include:
- Keeping it disabled (false) in most cases to maintain skeletal hierarchy integrity.
- Only enabling it temporarily when absolutely necessary for specific import or merge operations.
- Thoroughly testing the results of any merge operations performed with this variable enabled.
- Documenting any use of this variable in the project to ensure other team members are aware of potential implications.
Regarding the associated variable CVarAllowIncompatibleSkeletalMeshMerge:
- Its purpose is identical to a.Skeleton.AllowIncompatibleSkeletalMeshMerge.
- It is used in the USkeleton::MergeBonesToBoneTree function to determine whether to perform a parent chain check during bone merging.
- The value is retrieved using the GetValueOnGameThread() method, indicating it can be accessed at runtime.
- Developers should be aware that changes to this variable can affect the behavior of skeletal mesh merging operations throughout the engine.
- Best practices include using this variable consistently with a.Skeleton.AllowIncompatibleSkeletalMeshMerge and considering its impact on asset pipelines and runtime behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/Skeleton.cpp:66
Scope: file
Source code excerpt:
const FName FAnimSlotGroup::DefaultSlotName = FName(TEXT("DefaultSlot"));
TAutoConsoleVariable<bool> CVarAllowIncompatibleSkeletalMeshMerge(TEXT("a.Skeleton.AllowIncompatibleSkeletalMeshMerge"), 0, TEXT("When importing or otherwise merging in skeletal mesh bones, allow 'incompatible' hierarchies with bone insertions."));
void SerializeReferencePose(FArchive& Ar, FReferencePose& P, UObject* Outer)
{
Ar.UsingCustomVersion(FAnimPhysObjectVersion::GUID);
Ar << P.PoseName;
#Associated Variable and Callsites
This variable is associated with another variable named CVarAllowIncompatibleSkeletalMeshMerge
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/Skeleton.cpp:66
Scope: file
Source code excerpt:
const FName FAnimSlotGroup::DefaultSlotName = FName(TEXT("DefaultSlot"));
TAutoConsoleVariable<bool> CVarAllowIncompatibleSkeletalMeshMerge(TEXT("a.Skeleton.AllowIncompatibleSkeletalMeshMerge"), 0, TEXT("When importing or otherwise merging in skeletal mesh bones, allow 'incompatible' hierarchies with bone insertions."));
void SerializeReferencePose(FArchive& Ar, FReferencePose& P, UObject* Outer)
{
Ar.UsingCustomVersion(FAnimPhysObjectVersion::GUID);
Ar << P.PoseName;
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Animation/Skeleton.cpp:1046
Scope (from outer to inner):
file
function bool USkeleton::MergeBonesToBoneTree
Source code excerpt:
{
// Check if we can merge in the bones
const bool bDoParentChainCheck = !CVarAllowIncompatibleSkeletalMeshMerge.GetValueOnGameThread();
if( IsCompatibleMesh(InSkinnedAsset, bDoParentChainCheck) )
{
TRACE_CPUPROFILER_EVENT_SCOPE(USkeleton::MergeBonesToBoneTree::CompatibleBranch);
// Exclude bones who do not have a parent.
TArray<int32> FilteredRequiredBones;
FAnimationRuntime::ExcludeBonesWithNoParents(RequiredRefBones, InSkinnedAsset->GetRefSkeleton(), FilteredRequiredBones);