RealDocs

UAnimInstance::CalcSlotMontageLocalWeight

function Engine Since 4.14
#include "Animation/AnimInstance.h"
Access: public Specifiers: ENGINE_API

Description

Recalculates and returns the local montage blend weight for the named slot by iterating active montage instances directly. This is the underlying computation used by GetSlotMontageLocalWeight and Blueprint_GetSlotMontageLocalWeight.

Caveats & Gotchas

  • Calling this every tick is more expensive than reading the cached value from GetSlotMontageLocalWeight, which is updated once per frame by the animation graph. Prefer the cached getter unless you need an out-of-graph fresh value.
  • This is not exposed to Blueprint. It is intended for low-level C++ tooling (such as custom AnimGraph nodes) that needs the weight before the cached value has been refreshed for the current frame.

Signature

ENGINE_API float CalcSlotMontageLocalWeight(const FName& SlotNodeName) const;

Parameters

Name Type Description Default
SlotNodeName const FName& Name of the slot node whose local weight should be recalculated.

Return Type

float

Example

Custom AnimGraph node reading slot weight on demand C++
// Inside a custom FAnimNode_Base::Evaluate_AnyThread:
if (UAnimInstance* AnimInstance = Context.GetAnimInstanceObject())
{
    float LocalWeight = AnimInstance->CalcSlotMontageLocalWeight(SlotName);
    // Use LocalWeight to modulate blending before cache is updated
}

Version History

Introduced in: 4.14

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.