Blender Git Statistics -> Branches -> temp-nla-strip-alignment

"Temp-nla-strip-alignment" branch

Total commits : 22
Total committers : 1
First Commit : December 10, 2020
Latest Commit : December 10, 2020

Commits by Date

DateNumber of Commits
December 10, 202022


AuthorNumber of Commits
Wayde Moss22

Popular Files

FilenameTotal Edits

Latest commits Feed

December 10, 2020, 05:09 (GMT)
- normalize qt before doing math on them
- ensure strip alignment panel script loaded
December 10, 2020, 04:50 (GMT)
- clean up formatting and obselete comments
December 10, 2020, 04:35 (GMT)
- minor update for recent commits on master by others
December 10, 2020, 04:19 (GMT)
- bugfix: fixed the scaling problem. Was due to not normalizing quaternion after reading from fcurves
December 10, 2020, 04:19 (GMT)
- general bugfix that should be committed separately: context.selected_nla_strips would have the wrong pointerRNA associated with it. This leads to unresponsive UI when strip values changed through python-made UI.
December 10, 2020, 04:19 (GMT)
- due to last commit, no longer need C-side python UI for alignment properties
December 10, 2020, 04:19 (GMT)
- typo fix: rna_nla: remove parm
- blend xform allocation separated from adding to list to make duplication simpler
December 10, 2020, 04:18 (GMT)
- add proper support for duplicating nla strips with preblend transforms
December 10, 2020, 04:18 (GMT)
- renamed NlaStripPreBlendTransform to NlaBlendTransform, preblend to blend, etc
December 10, 2020, 04:17 (GMT)
- fix preblend transform deletion. By this point, we can actually test the alignment feature
December 10, 2020, 04:16 (GMT)
support for file read/writing new preblend xform data
December 10, 2020, 04:16 (GMT)
- used quaternion slerp through shortest angle for non full replace blends to fix issue of rotation through longer angle. Unsure if animator ever wants the opposite. If so, that makes things a bit more complicated for specifying which nla channels should have it applied.
December 10, 2020, 04:16 (GMT)
- actionclip raw eval temporarily always creates new channels until I update function call
December 10, 2020, 04:16 (GMT)
- rna for preblend bones (rna path not working properly)
December 10, 2020, 04:16 (GMT)
- fixed preblend xform struct byte alignment
- fixed rna collection to support add/removal of preblend xforms
- removed C-based nla alignment UI
December 10, 2020, 04:14 (GMT)
- WIP rough core implementation of strip preblend xform support for animation alignment
December 10, 2020, 04:14 (GMT)
- WIP add nla alignment UI in python
December 10, 2020, 04:14 (GMT)
-some early WIP for strip alignment:

Overall Need:
-ability to add NlaStrip preblend transform elements using UI
-add, remove, clear
-bone_name from selection, from active
-ability to copy bone targets between strips

-visualization of traversal bone for general alignment,
similar to motion paths but without the need for an accurate world
transform. It should update as preblend xform changes. Ideally this
path is grabbale and transformable like any other object.
Would require making own transform_convert_stripPreBlendTransform
code... (opportunity to make Python API for it?)

Core algorithm implementation:
-instead of blending strips as their value obtained, we need to
get all raw values. Then apply preblend xform, then we can blend the
whole snapshot. For efficiency, we can allocate the relevant NlaEvalChannels
for bones right after creating NlaEvalData.
December 10, 2020, 04:13 (GMT)
NLA: Action Strip Defaults Sync Length On

Differential Revision:
December 10, 2020, 04:11 (GMT)
Feature: NLA Merge Strips

Todo: add media and example files

This patch is relative to {D8296} (which is relative to {D9247}. Apply {D9247} first then {D8296} then this one.

For user-facing design discussion: {T80235}

Before, the only way to combine multiple Nla strips into a single strip is to execute a Bake operator. However, this will merge **all** strips into a replace strip with full influence. This patch creates a new operator "Resample Strips To New" which effectively allows merging a set of selected NlaStrips into a single strip of any blendmode and any nonzero influence. The old selected strips will be muted while preserving the whole Nla result. (I used the word "resample" because it's more general. But most animators will recognize it as a "merge"). This patch offers a more flexible solution to {T69105}, where the solution implemented was to force baking to a single replace strip with full influence.

**Feature:** Nla add support for resampling selected strips into a new track. The more specific use is to support merging selected Nla strips into a single strip. The core resampling function is (anim_sys.c) //BKE_animsys_resample_selected_strips()//

(direct copy+paste of function comment)
/** Mute selected NLA strips and resample into a new track. The final Nla stack result will be
* preserved when possible. New resampled strip will be selected. Previously selected strips will
* be muted and deselected afterward.
* param resample_blendmode: Resulting resampled strip's blend mode.
* param resample_influence: Resulting resampled strip's influence. above.
* param resample_insertion_nlt_index: NlaTrack to insert the resample track above or below.
* param insert_track_lower: Side of resample_insertion_nlt_index to place resample track.
* returns: The new resample track. Returns NULL and does nothing if in tweak mode, resample
* influence zero, or no fcurves are involved in the resample.

**Intended Uses:**

Merge Strips: User selects a block of NlaStrips and Resamples. Effectively, all selected strips will become muted and a new "merged" track will be created. Since the overall NLA stack result is preserved, the result is equivalent to a merge.

Convert Strip: User selects a single NlaStrip and Resamples with a different blendmode and/or influence.

**Potential improvements/changes:**

For frames where user had a keyframe, make them non-selected. Select non-user keys. This allows a follow-up op to do an Fcurve simplify or decimate of only the baked keyframes. Effectively it allows a follow-up Smart Bake that preserves user keys. Perhaps this can be done by the caller.

Allow user to somehow select channels to be resampled. Currently all channels found in all selected strips are resampled. Though a simple work around is to delete the undesired channels after the resample.

**Limitations and potential problems:**

Design: When resample strip value not valid, what should we do? Currently we write a default value. Nothing we write will preserve the animation. This leaves the problem as a "Known Issue".

This operator will not properly resample outside of the resample bounds. Generally, it's not possible since multiple strips with non-None extend modes can not be represented by a single strip of any extend mode.. Maybe it's possible by properly setting the pre and post extrapolation for individual fcurves?


**Some existing functions in (anim_sys.c) that had to be modified slightly for //BKE_animsys_resample_selected_strips()//:**

- changes (anim_sys.c) //nlastrip_evaluate()// and its nested calls to pass //allow_alloc_channels //to control whether NlaEvalChannels are allocated or to only blend existing channels. Flushing and keyframing require allocation. The new merging operator only needs to blend existing channels and requires no allocation.

There are potential areas for refactoring but haven't been implemented to keep the review simpler and more linear. It's an attempt to prevent introducing bugs that occur as a result of refactoring instead of the patch itself.

Differential Revision:

MiikaHweb - Blender Git Statistics v1.06
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021