RealDocs

FMontageSubStepper::Advance

function Engine Since unknown
#include "Animation/AnimMontage.h"
Access: public

Description

Moves montage playback position forward or backward by up to one sub-step, stopping at section boundaries, branching points, or TimeStretchCurve markers, and reports what happened via EMontageSubStepResult.

Caveats & Gotchas

  • Returns EMontageSubStepResult::InvalidSection or InvalidMontage rather than asserting when the montage or current section is no longer valid — callers must check the return value, not just assume Moved.
  • Called in a loop (guarded by HasTimeRemaining()) rather than once per tick, since a single frame's delta time can cross several section or marker boundaries.
  • OutBranchingPointMarkerPtr is only meaningful when a branching point was actually hit this sub-step; check it against nullptr before dereferencing.

Signature

EMontageSubStepResult Advance(float& InOut_P_Original, const FBranchingPointMarker** OutBranchingPointMarkerPtr)

Parameters

Name Type Description Default
InOut_P_Original float& Current montage position in original (unstretched) time space; updated in place as the sub-stepper moves it.
OutBranchingPointMarkerPtr const FBranchingPointMarker** Receives a pointer to the branching point marker hit during this sub-step, if any.

Return Type

EMontageSubStepResult

Example

Sub-stepping loop C++
// Engine-internal: FAnimMontageInstance::Advance()
while (MontageSubStepper.HasTimeRemaining())
{
	const FBranchingPointMarker* BranchingPointMarker = nullptr;
	const EMontageSubStepResult Result = MontageSubStepper.Advance(Position, &BranchingPointMarker);
	if (Result == EMontageSubStepResult::InvalidSection || Result == EMontageSubStepResult::InvalidMontage)
	{
		break;
	}
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.