Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayde Moss <GuiltyGhost>2021-05-11 23:04:18 +0300
committerWayde Moss <wbmoss_dev@yahoo.com>2021-05-12 05:00:07 +0300
commitcbeeca8167f840798a0977906be911a09e7a63dd (patch)
treea5629440d37085fda062d3733120276d4595ce3a /source/blender/blenkernel/nla_private.h
parent65244ac1c3f13802852d5ca2e340b85cc3e94c7a (diff)
NLA: Extract ..get_inverted_upper_snapshot()
Extracts `nlasnapshot_blend_get_inverted_upper_snapshot()` from `BKE_animsys_nla_remap_keyframe_values()` This introduces a new struct member: `NlaEvalChannelSnapshot->remap_domain` and marks which values of `blended_snapshot` are processed for remapping/used-for-inverting. Effectively, it marks which values have successfully been remapped and can be further used for remapping. `nlasnapshot_blend_get_inverted_upper_snapshot()`: output snapshot `r_upper_snapshot` has each channel's `remap_domain` written to which effectively marks the successfully remapped values. The only reason a value is not in the remap domain is if inversion failed or it wasn't marked to be remapped. `..get_inverted_upper_snapshot()` has a variant `nlasnapshot_blend()` from {D10220}, but this patch doesn't depend on it at all. A third variant will later be added `..get_inverted_lower_snapshot()`. Altogether, these three functions allow solving for any of (lower_snapshot, upper_snapshot, blended_snapshot) given the other two. The function `..get_inverted_lower_snapshot()` will also similarly process the remap domain of the blended and lower snapshot. added assertions within `nlasnapshot_blend()` and `..get_inverted_upper_snapshot()` to future proof branches dealing with blendmode and mixmodes. (suggested by sybren) No user functional changes Reviewed By: sybren Differential Revision: https://developer.blender.org/D10222
Diffstat (limited to 'source/blender/blenkernel/nla_private.h')
-rw-r--r--source/blender/blenkernel/nla_private.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h
index 706bcac4f17..71b5a74ddf7 100644
--- a/source/blender/blenkernel/nla_private.h
+++ b/source/blender/blenkernel/nla_private.h
@@ -82,6 +82,10 @@ typedef struct NlaEvalChannelSnapshot {
/** For an upper snapshot channel, marks values that should be blended. */
NlaValidMask blend_domain;
+ /** Only used for keyframe remapping. Any values not in the \a remap_domain will not be used
+ * for keyframe remapping. */
+ NlaValidMask remap_domain;
+
int length; /* Number of values in the property. */
bool is_base; /* Base snapshot of the channel. */
@@ -196,6 +200,13 @@ void nlasnapshot_blend(NlaEvalData *eval_data,
const float upper_influence,
NlaEvalSnapshot *r_blended_snapshot);
+void nlasnapshot_blend_get_inverted_upper_snapshot(NlaEvalData *eval_data,
+ NlaEvalSnapshot *lower_snapshot,
+ NlaEvalSnapshot *blended_snapshot,
+ const short upper_blendmode,
+ const float upper_influence,
+ NlaEvalSnapshot *r_upper_snapshot);
+
#ifdef __cplusplus
}
#endif