Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/anim_sys.c
| Show First 20 Lines • Show All 1,599 Lines • ▼ Show 20 Lines | case NEC_MIX_MULTIPLY: | ||||
| return true; | return true; | ||||
| default: | default: | ||||
| BLI_assert(!"invalid mix mode"); | BLI_assert(!"invalid mix mode"); | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| /** Accumulate quaternion channels for Combine mode according to influence. | /** | ||||
| * \returns blended_value = lower_values @ strip_values^infl | * Accumulate quaternion channels for Combine mode according to influence. | ||||
| * \returns `blended_value = lower_values @ strip_values^infl` | |||||
| */ | */ | ||||
| static void nla_combine_quaternion(const float lower_values[4], | static void nla_combine_quaternion(const float lower_values[4], | ||||
| const float strip_values[4], | const float strip_values[4], | ||||
| const float influence, | const float influence, | ||||
| float r_blended_value[4]) | float r_blended_value[4]) | ||||
| { | { | ||||
| float tmp_lower[4], tmp_strip_values[4]; | float tmp_lower[4], tmp_strip_values[4]; | ||||
| ▲ Show 20 Lines • Show All 471 Lines • ▼ Show 20 Lines | LISTBASE_FOREACH (NlaTrack *, nlt, &adt->nla_tracks) { | ||||
| nla_eval_domain_strips(ptr, channels, &nlt->strips, touched_actions); | nla_eval_domain_strips(ptr, channels, &nlt->strips, touched_actions); | ||||
| } | } | ||||
| BLI_gset_free(touched_actions, NULL); | BLI_gset_free(touched_actions, NULL); | ||||
| } | } | ||||
| /* ---------------------- */ | /* ---------------------- */ | ||||
| /** Tweaked strip is evaluated differently from other strips. Adjacent strips are ignored | /** | ||||
| * and includes a workaround for when user is not editing in place. */ | * Tweaked strip is evaluated differently from other strips. Adjacent strips are ignored | ||||
| * and includes a workaround for when user is not editing in place. | |||||
| */ | |||||
| static void animsys_create_tweak_strip(const AnimData *adt, | static void animsys_create_tweak_strip(const AnimData *adt, | ||||
| const bool keyframing_to_strip, | const bool keyframing_to_strip, | ||||
| NlaStrip *r_tweak_strip) | NlaStrip *r_tweak_strip) | ||||
| { | { | ||||
| /* Copy active strip so we can modify how it evaluates without affecting user data. */ | /* Copy active strip so we can modify how it evaluates without affecting user data. */ | ||||
| memcpy(r_tweak_strip, adt->actstrip, sizeof(NlaStrip)); | memcpy(r_tweak_strip, adt->actstrip, sizeof(NlaStrip)); | ||||
| r_tweak_strip->next = r_tweak_strip->prev = NULL; | r_tweak_strip->next = r_tweak_strip->prev = NULL; | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | else { | ||||
| if (nlt->flag & NLATRACK_MUTED) { | if (nlt->flag & NLATRACK_MUTED) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| } | } | ||||
| return true; | return true; | ||||
| } | } | ||||
| /** Check for special case of non-pushed action being evaluated with no NLA influence (off and no | /** | ||||
| * strips evaluated) nor NLA interference (ensure NLA not soloing). */ | * Check for special case of non-pushed action being evaluated with no NLA influence (off and no | ||||
| * strips evaluated) nor NLA interference (ensure NLA not soloing). | |||||
| */ | |||||
| static bool is_action_track_evaluated_without_nla(const AnimData *adt, | static bool is_action_track_evaluated_without_nla(const AnimData *adt, | ||||
| const bool any_strip_evaluated) | const bool any_strip_evaluated) | ||||
| { | { | ||||
| if (adt->action == NULL) { | if (adt->action == NULL) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (any_strip_evaluated) { | if (any_strip_evaluated) { | ||||
| ▲ Show 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | |||||
| void nlasnapshot_ensure_channels(NlaEvalData *eval_data, NlaEvalSnapshot *snapshot) | void nlasnapshot_ensure_channels(NlaEvalData *eval_data, NlaEvalSnapshot *snapshot) | ||||
| { | { | ||||
| LISTBASE_FOREACH (NlaEvalChannel *, nec, &eval_data->channels) { | LISTBASE_FOREACH (NlaEvalChannel *, nec, &eval_data->channels) { | ||||
| nlaeval_snapshot_ensure_channel(snapshot, nec); | nlaeval_snapshot_ensure_channel(snapshot, nec); | ||||
| } | } | ||||
| } | } | ||||
| /** Blends the \a lower_snapshot with the \a upper_snapshot into \a r_blended_snapshot according | /** | ||||
| * Blends the \a lower_snapshot with the \a upper_snapshot into \a r_blended_snapshot according | |||||
| * to the given \a upper_blendmode and \a upper_influence. | * to the given \a upper_blendmode and \a upper_influence. | ||||
| * | * | ||||
| * For \a upper_snapshot, blending limited to values in the \a blend_domain. For Replace blendmode, | * For \a upper_snapshot, blending limited to values in the \a blend_domain. For Replace blendmode, | ||||
| * this allows the upper snapshot to have a location XYZ channel where only a subset of values are | * this allows the upper snapshot to have a location XYZ channel where only a subset of values are | ||||
| * blended. | * blended. | ||||
| */ | */ | ||||
| void nlasnapshot_blend(NlaEvalData *eval_data, | void nlasnapshot_blend(NlaEvalData *eval_data, | ||||
| NlaEvalSnapshot *lower_snapshot, | NlaEvalSnapshot *lower_snapshot, | ||||
| ▲ Show 20 Lines • Show All 629 Lines • Show Last 20 Lines | |||||