[Bf-blender-cvs] [af6a6627984] blender2.8: Preview Range: Show preview range using a different color (based on ANIM_ACTIVE) instead of using "black" curtains

Joshua Leung noreply at git.blender.org
Fri Apr 20 19:06:45 CEST 2018


Commit: af6a6627984372b850aac3f3135946ee5c6cb33e
Author: Joshua Leung
Date:   Thu Apr 19 18:21:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBaf6a6627984372b850aac3f3135946ee5c6cb33e

Preview Range: Show preview range using a different color (based on ANIM_ACTIVE)
instead of using "black" curtains

With most editors now showing the start/end range by default, we need a way of
easily distinguishing when preview range is now enabled. By using a different color
(the exact color used is something we can change/adjust later), there is a more distinct
visual difference between them, making it easier to see what's happening.

===================================================================

M	source/blender/editors/animation/anim_draw.c
M	source/blender/editors/interface/resources.c

===================================================================

diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index d903d8d9235..623a3e82ecc 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -167,7 +167,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
 		unsigned int pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
 
 		immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
-		immUniformColor4f(0.0f, 0.0f, 0.0f, 0.4f);
+		immUniformThemeColorShadeAlpha(TH_ANIM_ACTIVE, -25, -30);
+		//immUniformColor4f(0.8f, 0.44f, 0.1f, 0.2f); /* XXX: Fix this hardcoded color (anim_active) */
 
 		/* only draw two separate 'curtains' if there's no overlap between them */
 		if (PSFRA < PEFRA + end_frame_width) {
@@ -190,7 +191,14 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
 /* Draw frame range guides (for scene frame range) in background */
 // TODO: Should we still show these when preview range is enabled?
 void ANIM_draw_framerange(Scene *scene, View2D *v2d)
-{	
+{
+	/* Don't draw frame range when preview range is enabled.
+	 * Otherwise we get nasty/confusing visual conflicts
+	 */
+	if (PRVRANGEON) {
+		return;
+	}
+	
 	/* draw darkened area outside of active timeline frame range */
 	glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
 	glEnable(GL_BLEND);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index b40ab09036f..1a6665ffa19 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2951,6 +2951,18 @@ void init_userdef_do_versions(void)
 			copy_v4_v4_char(btheme->ttopbar.back, tmp);
 		}
 	}
+	
+	if (!USER_VERSION_ATLEAST(280, 9)) {
+		/* Timeline removal */
+		for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) {
+			if (btheme->tipo.anim_active[3] == 0) {
+				rgba_char_args_set(btheme->tipo.anim_active,    204, 112, 26, 102);
+			}
+			if (btheme->tseq.anim_active[3] == 0) {
+				rgba_char_args_set(btheme->tseq.anim_active,    204, 112, 26, 102);	
+			}
+		}
+	}
 
 	/**
 	 * Include next version bump.



More information about the Bf-blender-cvs mailing list