[Bf-blender-cvs] [895fa8b] master: Timeline: Draw keyframe lines at 60% height

Sybren A. Stüvel noreply at git.blender.org
Mon Jan 26 14:50:05 CET 2015


Commit: 895fa8bc791d8c7a87e185b058a7ee647f64d48f
Author: Sybren A. Stüvel
Date:   Mon Jan 26 14:48:51 2015 +0100
Branches: master
https://developer.blender.org/rB895fa8bc791d8c7a87e185b058a7ee647f64d48f

Timeline: Draw keyframe lines at 60% height

This patch updates the timeline editor. Ordinarily, it draws the
yellow keyframe lines at 100% of the available height. This becomes an
issue when there are keyframes for every frame, which can happen when
importing motion capture data or recording animations from the BGE. In
such cases, the green "current frame" indicator becomes very hard to
see.

This patch restricts the drawing to the bottom 60% of the available
space, thereby making the "current frame" indicator more visible.

Reviewers: aligorith

Reviewed By: aligorith

Subscribers: Severin

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1033

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

M	source/blender/editors/space_time/space_time.c

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

diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index 7709980..c5ac67a 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -295,6 +295,8 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
 	bDopeSheet ads = {NULL};
 	DLRBT_Tree keys;
 	ActKeyColumn *ak;
+	float ymin = v2d->tot.ymin;
+	float ymax = v2d->tot.ymax * 0.6f + ymin * 0.4f;
 	
 	/* init binarytree-list for getting keyframes */
 	BLI_dlrbTree_init(&keys);
@@ -302,7 +304,7 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
 	/* init dopesheet settings */
 	if (onlysel)
 		ads.filterflag |= ADS_FILTER_ONLYSEL;
-	
+
 	/* populate tree with keyframe nodes */
 	switch (GS(id->name)) {
 		case ID_SCE:
@@ -329,8 +331,8 @@ static void time_draw_idblock_keyframes(View2D *v2d, ID *id, short onlysel)
 	     (ak) && (ak->cfra <= v2d->cur.xmax);
 	     ak = ak->next)
 	{
-		glVertex2f(ak->cfra, v2d->tot.ymin);
-		glVertex2f(ak->cfra, v2d->tot.ymax);
+		glVertex2f(ak->cfra, ymin);
+		glVertex2f(ak->cfra, ymax);
 	}
 	glEnd(); // GL_LINES




More information about the Bf-blender-cvs mailing list