Skip to content

Add motion matching node system to animation framework#69

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/add-motion-matching-nodes
Draft

Add motion matching node system to animation framework#69
Copilot wants to merge 6 commits intomainfrom
copilot/add-motion-matching-nodes

Conversation

Copy link

Copilot AI commented Feb 17, 2026

Implements motion matching for data-driven character animation selection. The system automatically selects and transitions between animation clips based on desired velocity and trajectory, eliminating manual state machine transitions.

Architecture

Three core components integrate with the existing AnimNode system:

  • MotionDatabase: Stores animation clips with extracted features (joint positions/velocities, root velocity, future trajectory). Configurable sampling rate for feature extraction.
  • MotionMatcher: Finds best-matching frame using weighted cost function across pose, velocity, and trajectory features.
  • MotionMatchingNode: AnimNode implementation that performs periodic matching searches and handles smooth transitions with configurable blend time and search intervals.

Usage

// Build database
auto database = std::make_shared<MotionDatabase>();
database->AddClip(walkClip, 30);
database->AddClip(runClip, 30);
database->AddClip(jumpClip, 30);

// Configure node
MotionMatchingNode::PersistentData config;
config.database = database;
config.blendTime = 0.2f;      // 200ms transitions
config.searchInterval = 3;     // Search every 3 frames

MotionMatchingNode node(config);

// Runtime control
node.SetDesiredVelocity(Vector3(2.0f, 0.0f, 1.0f));
node.SetDesiredTrajectory({...});

Integration

Follows existing animation graph patterns:

  • Inherits from AnimNode with standard InitAny/TickAny/EvalAny interface
  • Uses AnimationSequencePlayer for playback timing
  • Leverages AnimFadeInOut for transition blending
  • Compatible with root motion and bone masking

Implementation Notes

  • Feature extraction in MotionDatabase::ExtractFeatures is placeholder; production use requires full pose/velocity computation
  • Search is linear O(n); consider spatial acceleration structures (KD-tree) for large databases
  • Weight configuration (pose/velocity/trajectory) affects matching behavior significantly

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits February 17, 2026 09:35
…, MotionMatchingNode)

Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Co-authored-by: bluesky013 <35895395+bluesky013@users.noreply.github.com>
Copilot AI changed the title [WIP] Add motion matching nodes to existing animation system Add motion matching node system to animation framework Feb 17, 2026
Copilot AI requested a review from bluesky013 February 17, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants