diff options
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r-- | source/blender/editors/space_nla/nla_draw.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_edit.c | 13 |
2 files changed, 19 insertions, 3 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index bf2d20cf4c9..4f335a0d13a 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -111,11 +111,11 @@ static void nla_action_draw_keyframes( /* draw a darkened region behind the strips * - get and reset the background color, this time without the alpha to stand out better - * (amplified alpha is used instead) + * (amplified alpha is used instead, but clamped to avoid 100% opacity) */ float color[4]; nla_action_get_color(adt, act, color); - color[3] *= 2.5f; + color[3] = min_ff(0.7f, color[3] * 2.5f); GPUVertFormat *format = immVertexFormat(); uint pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); @@ -786,6 +786,11 @@ void draw_nla_main_data(bAnimContext *ac, SpaceNla *snla, ARegion *region) case ANIMTYPE_NLAACTION: { AnimData *adt = ale->adt; + /* Draw the manually set intended playback frame range highlight. */ + if (ale->data) { + ANIM_draw_action_framerange(adt, ale->data, v2d, ymin, ymax); + } + uint pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 62f8906d136..9f42e6378ca 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -2193,8 +2193,19 @@ static int nlaedit_apply_scale_exec(bContext *C, wmOperator *UNUSED(op)) * and recalculate the extents of the action now that it has been scaled * but leave everything else alone */ + const float start = nlastrip_get_frame(strip, strip->actstart, NLATIME_CONVERT_MAP); + const float end = nlastrip_get_frame(strip, strip->actend, NLATIME_CONVERT_MAP); + + if (strip->act->flag & ACT_FRAME_RANGE) { + strip->act->frame_start = nlastrip_get_frame( + strip, strip->act->frame_start, NLATIME_CONVERT_MAP); + strip->act->frame_end = nlastrip_get_frame( + strip, strip->act->frame_end, NLATIME_CONVERT_MAP); + } + strip->scale = 1.0f; - calc_action_range(strip->act, &strip->actstart, &strip->actend, 0); + strip->actstart = start; + strip->actend = end; ale->update |= ANIM_UPDATE_DEPS; } |