diff options
author | Wayde Moss <wbmoss_dev@yahoo.com> | 2021-03-09 03:44:20 +0300 |
---|---|---|
committer | Wayde Moss <wbmoss_dev@yahoo.com> | 2021-03-09 03:44:36 +0300 |
commit | 6a3ae75656a4247d39050c54ce5a6edf4f67d29f (patch) | |
tree | e5df116f2ec84e07cb563059c17fa3b8439e9569 /source/blender/editors | |
parent | d25ab68cf4b28c01281dd689a3926887fa7d32a4 (diff) |
manual patchtemp_D10504-2_nla_keyframe_remap_upper_strips
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 17 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 15 |
2 files changed, 26 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 4cc0413be5b..10df3804cbd 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1122,7 +1122,8 @@ static float *get_keyframe_values(ReportList *reports, float *buffer, int buffer_size, int *r_count, - bool *r_force_all) + bool *r_force_all, + const struct AnimationEvalContext *anim_eval_context) { float *values; @@ -1140,9 +1141,11 @@ static float *get_keyframe_values(ReportList *reports, /* adjust the value for NLA factors */ if (!BKE_animsys_nla_remap_keyframe_values( - nla_context, &ptr, prop, values, *r_count, index, r_force_all)) { - BKE_report( - reports, RPT_ERROR, "Could not insert keyframe due to zero NLA influence or base value"); + nla_context, &ptr, prop, values, *r_count, index, r_force_all, anim_eval_context)) { + BKE_report(reports, + RPT_ERROR, + "Could not insert keyframe due to zero NLA influence, base value, or value " + "remapping failed"); if (values != buffer) { MEM_freeN(values); @@ -1306,7 +1309,8 @@ bool insert_keyframe_direct(ReportList *reports, value_buffer, RNA_MAX_ARRAY_LENGTH, &value_count, - NULL); + NULL, + anim_eval_context); if (values == NULL) { /* This happens if NLA rejects this insertion. */ @@ -1480,7 +1484,8 @@ int insert_keyframe(Main *bmain, value_buffer, RNA_MAX_ARRAY_LENGTH, &value_count, - &force_all); + &force_all, + anim_eval_context); if (values != NULL) { /* Key the entire array. */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index dd381cc92fb..88beb21f228 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -114,6 +114,7 @@ static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) int filter; const bool do_solo = RNA_boolean_get(op->ptr, "isolate_action"); + const bool use_upper_stack_evaluation = RNA_boolean_get(op->ptr, "use_upper_stack_evaluation"); bool ok = false; /* get editor data */ @@ -135,6 +136,13 @@ static int nlaedit_enable_tweakmode_exec(bContext *C, wmOperator *op) for (ale = anim_data.first; ale; ale = ale->next) { AnimData *adt = ale->data; + if (use_upper_stack_evaluation) { + adt->flag |= ADT_NLA_EVAL_UPPER_TRACKS; + } + else { + adt->flag &= ~ADT_NLA_EVAL_UPPER_TRACKS; + } + /* try entering tweakmode if valid */ ok |= BKE_nla_tweakmode_enter(adt); @@ -198,6 +206,13 @@ void NLA_OT_tweakmode_enter(wmOperatorType *ot) "Enable 'solo' on the NLA Track containing the active strip, " "to edit it without seeing the effects of the NLA stack"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); + + prop = RNA_def_boolean(ot->srna, + "use_upper_stack_evaluation", + false, + "Evaluate Upper Stack", + "In tweak mode, display the effects of the tracks above the tweak strip"); + RNA_def_property_flag(prop, PROP_SKIP_SAVE); } /** \} */ |