[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55937] trunk/blender/source/blender/ editors: Fix #34941: Space. draw_handler_add now supports PRE_VIEW and POST_VIEW callbacks

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Apr 10 18:59:57 CEST 2013


Revision: 55937
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55937
Author:   blendix
Date:     2013-04-10 16:59:55 +0000 (Wed, 10 Apr 2013)
Log Message:
-----------
Fix #34941: Space.draw_handler_add now supports PRE_VIEW and POST_VIEW callbacks
for more editors: timeline, graph, action, NLA, sequencer, image, clip.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/ED_mask.h
    trunk/blender/source/blender/editors/mask/mask_draw.c
    trunk/blender/source/blender/editors/space_action/space_action.c
    trunk/blender/source/blender/editors/space_graph/space_graph.c
    trunk/blender/source/blender/editors/space_image/space_image.c
    trunk/blender/source/blender/editors/space_nla/space_nla.c
    trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
    trunk/blender/source/blender/editors/space_time/space_time.c

Modified: trunk/blender/source/blender/editors/include/ED_mask.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_mask.h	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/include/ED_mask.h	2013-04-10 16:59:55 UTC (rev 55937)
@@ -58,7 +58,7 @@
                          const char draw_flag, const char draw_type,
                          const int width_i, const int height_i,
                          const float aspx, const float aspy,
-                         const short do_scale_applied, const short do_post_draw,
+                         const short do_scale_applied, const short do_draw_cb,
                          float stabmat[4][4],
                          const struct bContext *C);
 

Modified: trunk/blender/source/blender/editors/mask/mask_draw.c
===================================================================
--- trunk/blender/source/blender/editors/mask/mask_draw.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/mask/mask_draw.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -541,7 +541,7 @@
                          const char draw_flag, const char draw_type,
                          const int width_i, const int height_i,  /* convert directly into aspect corrected vars */
                          const float aspx, const float aspy,
-                         const short do_scale_applied, const short do_post_draw,
+                         const short do_scale_applied, const short do_draw_cb,
                          float stabmat[4][4], /* optional - only used by clip */
                          const bContext *C    /* optional - only used when do_post_draw is set or called from clip editor */
                          )
@@ -601,10 +601,14 @@
 		glMultMatrixf(stabmat);
 	}
 
+	if (do_draw_cb) {
+		ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+	}
+
 	/* draw! */
 	draw_masklays(C, mask, draw_flag, draw_type, width, height);
 
-	if (do_post_draw) {
+	if (do_draw_cb) {
 		ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
 	}
 

Modified: trunk/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- trunk/blender/source/blender/editors/space_action/space_action.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_action/space_action.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -185,6 +185,8 @@
 	UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
 	UI_view2d_grid_free(grid);
 	
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
 	/* data */
 	if (ANIM_animdata_get_context(C, &ac)) {
 		draw_channel_strips(&ac, saction, ar);
@@ -204,6 +206,10 @@
 	/* preview range */
 	UI_view2d_view_ortho(v2d);
 	ANIM_draw_previewrange(C, v2d);
+
+	/* callback */
+	UI_view2d_view_ortho(v2d);
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
 	
 	/* reset view matrix */
 	UI_view2d_view_restore(C);

Modified: trunk/blender/source/blender/editors/space_graph/space_graph.c
===================================================================
--- trunk/blender/source/blender/editors/space_graph/space_graph.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_graph/space_graph.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -242,6 +242,8 @@
 	grid = UI_view2d_grid_calc(CTX_data_scene(C), v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy);
 	UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
 	
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
 	/* draw data */
 	if (ANIM_animdata_get_context(C, &ac)) {
 		/* draw ghost curves */
@@ -295,6 +297,10 @@
 	UI_view2d_view_ortho(v2d);
 	ANIM_draw_previewrange(C, v2d);
 	
+	/* callback */
+	UI_view2d_view_ortho(v2d);
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
 	

Modified: trunk/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/space_image.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_image/space_image.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -667,6 +667,9 @@
 
 	/* and uvs in 0.0-1.0 space */
 	UI_view2d_view_ortho(v2d);
+
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
 	draw_uvedit_main(sima, ar, scene, obedit, obact);
 
 	/* check for mask (delay draw) */

Modified: trunk/blender/source/blender/editors/space_nla/space_nla.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/space_nla.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_nla/space_nla.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -284,6 +284,8 @@
 	UI_view2d_grid_draw(v2d, grid, V2D_GRIDLINES_ALL);
 	UI_view2d_grid_free(grid);
 	
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
 	/* data */
 	if (ANIM_animdata_get_context(C, &ac)) {
 		/* strips and backdrops */
@@ -308,6 +310,10 @@
 	UI_view2d_view_ortho(v2d);
 	ANIM_draw_previewrange(C, v2d);
 	
+	/* callback */
+	UI_view2d_view_ortho(v2d);
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
 	

Modified: trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -1404,6 +1404,8 @@
 	/* regular grid-pattern over the rest of the view (i.e. 25-frame grid lines) */
 	// NOTE: the gridlines are currently spaced every 25 frames, which is only fine for 25 fps, but maybe not for 30...
 	UI_view2d_constant_grid_draw(v2d);
+
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
 	
 	seq_draw_sfra_efra(scene, v2d);
 
@@ -1443,6 +1445,9 @@
 
 	}
 	
+	/* callback */
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
 

Modified: trunk/blender/source/blender/editors/space_time/space_time.c
===================================================================
--- trunk/blender/source/blender/editors/space_time/space_time.c	2013-04-10 15:22:39 UTC (rev 55936)
+++ trunk/blender/source/blender/editors/space_time/space_time.c	2013-04-10 16:59:55 UTC (rev 55937)
@@ -487,6 +487,8 @@
 	UI_view2d_grid_draw(v2d, grid, (V2D_VERTICAL_LINES | V2D_VERTICAL_AXIS));
 	UI_view2d_grid_free(grid);
 	
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
+
 	/* start and end frame */
 	time_draw_sfra_efra(scene, v2d);
 	
@@ -508,6 +510,10 @@
 	/* caches */
 	time_draw_cache(stime, obact, scene);
 	
+	/* callback */
+	UI_view2d_view_ortho(v2d);
+	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
+
 	/* reset view matrix */
 	UI_view2d_view_restore(C);
 	




More information about the Bf-blender-cvs mailing list