Page MenuHome

NLA: Extract nlasnapshot_blend()
ClosedPublic

Authored by Wayde Moss (GuiltyGhost) on Jan 27 2021, 6:35 AM.

Details

Summary

Refactor nlastrip_evaluate_actionclip() and nlaeval_blend_value() into nlasnapshot_blend(), nlastrip_evaluate_actionclip(), and nlasnapshot_from_action().

Motivations:

  • T83615: NLA: Strip Blend-space Transforms to Easily Align Actions Requires reading all pose bone fcurves before being able to apply pre-blend transforms. The function nlasnapshot_from_action() achieves this. This effectively removed the need to specially handle Quaternion blend queuing so that code has been removed.
  • D8296: Feature: NLA: Evaluate Whole NLA Stack in Tweak Mode Adds support for keyframe remapping through an upper stack of strips. Instead of introducing a variant of the form: nlastrip_evaluate_actionclip_inverted_get_lower(), nlastrip_evaluate_actionclip() will later be extended to take an evaluation_mode as input to avoid duplicating the recursion functions related to nlastrip_evaluate().
  • nlasnapshot_blend() will eventually have variants of nlasnapshot_blend_get_inverted_lower_snapshot() and nlasnapshot_blend_get_inverted_upper_snapshot() which are all independent of NlaStrips and NlaTracks, further simplifying the blending implementation. Ideally, nlastrip_evaluate() would get renamed to nlasnapshot_blend_strip() but that'll be a later patch to avoid unnecessary patches slowing the review of more important patches.

No Functional changes

Diff Detail

Repository
rB Blender
Branch
nla_refactor_snapshotblend (branched from master)
Build Status
Buildable 12408
Build 12408: arc lint + arc unit

Event Timeline

Wayde Moss (GuiltyGhost) requested review of this revision.Jan 27 2021, 6:35 AM
Wayde Moss (GuiltyGhost) created this revision.
Wayde Moss (GuiltyGhost) retitled this revision from - NLA: Extract nlasnapshot_blend() to NLA: Extract nlasnapshot_blend().Jan 27 2021, 7:10 AM
Wayde Moss (GuiltyGhost) edited the summary of this revision. (Show Details)

Nice cleanup!

source/blender/blenkernel/intern/anim_sys.c
1795

FCurve *fcu can be declared inside the for-loop, as it's not used outside of it.
This is not a vital thing to change, though, so feel free to commit with or without this change.

This revision is now accepted and ready to land.Jan 29 2021, 2:31 PM
This revision was automatically updated to reflect the committed changes.