[Bf-blender-cvs] [9a9347e] wiggly-widgets: Gooseberry request draw sequencer backdrop on -top- of everything.

Antony Riakiotakis noreply at git.blender.org
Fri Dec 12 13:03:53 CET 2014


Commit: 9a9347eb8d58bf35b6699550861ed47535e736e2
Author: Antony Riakiotakis
Date:   Fri Dec 12 13:02:23 2014 +0100
Branches: wiggly-widgets
https://developer.blender.org/rB9a9347eb8d58bf35b6699550861ed47535e736e2

Gooseberry request draw sequencer backdrop on -top- of everything.

Due to this we -obviously- rename this to overdrop

I am not sure if others would agree here, but it's pretty safe to do
this on a branch first. Rationale is that it's much nicer to work on
full screen with this.

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

M	release/scripts/startup/bl_ui/space_sequencer.py
M	source/blender/blenloader/intern/versioning_270.c
M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/editors/space_sequencer/sequencer_view.c
M	source/blender/editors/space_sequencer/space_sequencer.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 7eaf300..47fd8ef 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -84,7 +84,7 @@ class SEQUENCER_HT_header(Header):
 
             layout.separator()
             layout.operator("sequencer.refresh_all")
-            layout.prop(st, "show_backdrop")
+            layout.prop(st, "show_overdrop")
         else:
             if st.view_type == 'SEQUENCER_PREVIEW':
                 layout.separator()
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 8d1d1b5..96e6822 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -449,7 +449,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
 					}
 					if (sl->spacetype == SPACE_SEQ) {
 						SpaceSeq *sseq = (SpaceSeq *)sl;
-						sseq->backdrop_zoom = 1.0;
+						sseq->overdrop_zoom = 1.0;
 					}
 					
 				}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 84bb251..34e81af 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -935,7 +935,7 @@ static ImBuf *sequencer_make_scope(Scene *scene, ImBuf *ibuf, ImBuf *(*make_scop
 	return scope;
 }
 
-void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs, bool draw_overlay, bool draw_backdrop)
+void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq, int cfra, int frame_ofs, bool draw_overlay, bool draw_overdrop)
 {
 	struct Main *bmain = CTX_data_main(C);
 	struct ImBuf *ibuf = NULL;
@@ -991,7 +991,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 		viewrecty /= proxy_size / 100.0f;
 	}
 
-	if ((!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) && !draw_backdrop) {
+	if ((!draw_overlay || sseq->overlay_type == SEQ_DRAW_OVERLAY_REFERENCE) && !draw_overdrop) {
 		UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col);
 		glClearColor(col[0], col[1], col[2], 0.0);
 		glClear(GL_COLOR_BUFFER_BIT);
@@ -1066,7 +1066,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 	/* without this colors can flicker from previous opengl state */
 	glColor4ub(255, 255, 255, 255);
 
-	if (!draw_backdrop) {
+	if (!draw_overdrop) {
 		UI_view2d_totRect_set(v2d, viewrectx + 0.5f, viewrecty + 0.5f);
 		UI_view2d_curRect_validate(v2d);
 		
@@ -1174,7 +1174,7 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 	else
 		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ibuf->x, ibuf->y, 0, format, type, display_buffer);
 
-	if (draw_backdrop) {
+	if (draw_overdrop) {
 		UI_view2d_view_restore(C);
 	}
 	glBegin(GL_QUADS);
@@ -1199,11 +1199,11 @@ void draw_image_seq(const bContext *C, Scene *scene, ARegion *ar, SpaceSeq *sseq
 			glTexCoord2f(1.0f, 0.0f); glVertex2f(v2d->tot.xmax, v2d->tot.ymin);
 		}
 	}
-	else if (draw_backdrop) {
-		float imagex = (scene->r.size * scene->r.xsch) / 200.0f * sseq->backdrop_zoom;
-		float imagey = (scene->r.size * scene->r.ysch) / 200.0f * sseq->backdrop_zoom;
-		float xofs = BLI_rcti_size_x(&ar->winrct)/2.0f + sseq->backdrop_offset[0];
-		float yofs = BLI_rcti_size_y(&ar->winrct)/2.0f + sseq->backdrop_offset[1];
+	else if (draw_overdrop) {
+		float imagex = (scene->r.size * scene->r.xsch) / 200.0f * sseq->overdrop_zoom;
+		float imagey = (scene->r.size * scene->r.ysch) / 200.0f * sseq->overdrop_zoom;
+		float xofs = BLI_rcti_size_x(&ar->winrct)/2.0f + sseq->overdrop_offset[0];
+		float yofs = BLI_rcti_size_y(&ar->winrct)/2.0f + sseq->overdrop_offset[1];
 		
 		glTexCoord2f(0.0f, 0.0f); glVertex2f(-imagex + xofs, -imagey + yofs);
 		glTexCoord2f(0.0f, 1.0f); glVertex2f(-imagex + xofs, imagey + yofs);
@@ -1502,12 +1502,6 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
 	// 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);
 
-	if (sseq->draw_flag & SEQ_DRAW_BACKDROP) {
-		draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0, false, true);
-		UI_SetTheme(SPACE_SEQ, RGN_TYPE_WINDOW);
-		UI_view2d_view_ortho(v2d);
-	}
-		
 	ED_region_draw_cb_draw(C, ar, REGION_DRAW_PRE_VIEW);
 	
 	seq_draw_sfra_efra(scene, v2d);
@@ -1547,6 +1541,12 @@ void draw_timeline_seq(const bContext *C, ARegion *ar)
 		glEnd();
 
 	}
+
+	if (sseq->draw_flag & SEQ_DRAW_OVERDROP) {
+		draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0, false, true);
+		UI_SetTheme(SPACE_SEQ, RGN_TYPE_WINDOW);
+		UI_view2d_view_ortho(v2d);
+	}
 	
 	/* callback */
 	ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST_VIEW);
diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c
index 01e7605..74bd9114 100644
--- a/source/blender/editors/space_sequencer/sequencer_view.c
+++ b/source/blender/editors/space_sequencer/sequencer_view.c
@@ -256,7 +256,7 @@ static int sequencer_backdrop_transform_poll(bContext *C)
 	SpaceSeq *sseq = CTX_wm_space_seq(C);
 	ARegion *ar = CTX_wm_region(C);
 
-	return (sseq && ar && ar->type->regionid == RGN_TYPE_WINDOW && (sseq->draw_flag & SEQ_DRAW_BACKDROP));
+	return (sseq && ar && ar->type->regionid == RGN_TYPE_WINDOW && (sseq->draw_flag & SEQ_DRAW_OVERDROP));
 }
 
 static void widgetgroup_backdrop_draw(const struct bContext *C, struct wmWidgetGroup *wgroup)
@@ -289,11 +289,11 @@ static int sequencer_backdrop_transform_invoke(bContext *C, wmOperator *op, cons
 	BackDropTransformData *data = MEM_mallocN(sizeof(BackDropTransformData), "backdrop transform data");
 	WM_modal_handler_attach_widgetgroup(C, handler, cagetype, op);
 	
-	RNA_float_set_array(op->ptr, "offset", sseq->backdrop_offset);
-	RNA_float_set(op->ptr, "scale", sseq->backdrop_zoom);
+	RNA_float_set_array(op->ptr, "offset", sseq->overdrop_offset);
+	RNA_float_set(op->ptr, "scale", sseq->overdrop_zoom);
 
-	copy_v2_v2(data->init_offset, sseq->backdrop_offset);
-	data->init_zoom = sseq->backdrop_zoom;
+	copy_v2_v2(data->init_offset, sseq->overdrop_offset);
+	data->init_zoom = sseq->overdrop_zoom;
 	data->cagetype = cagetype;
 
 	op->customdata = data;
@@ -308,8 +308,8 @@ static int sequencer_backdrop_transform_modal(bContext *C, wmOperator *op, const
 	switch (event->type) {
 		case EVT_WIDGET_UPDATE: {
 			SpaceSeq *sseq = CTX_wm_space_seq(C);
-			RNA_float_get_array(op->ptr, "offset", sseq->backdrop_offset);
-			sseq->backdrop_zoom = RNA_float_get(op->ptr, "scale");
+			RNA_float_get_array(op->ptr, "offset", sseq->overdrop_offset);
+			sseq->overdrop_zoom = RNA_float_get(op->ptr, "scale");
 			break;
 		}
 			
@@ -320,8 +320,8 @@ static int sequencer_backdrop_transform_modal(bContext *C, wmOperator *op, const
 			float zero[2] = {0.0f};
 			RNA_float_set_array(op->ptr, "offset", zero);
 			RNA_float_set(op->ptr, "scale", 1.0f);
-			copy_v2_v2(sseq->backdrop_offset, zero);
-			sseq->backdrop_zoom = 1.0;
+			copy_v2_v2(sseq->overdrop_offset, zero);
+			sseq->overdrop_zoom = 1.0;
 			ED_region_tag_redraw(ar);
 			/* add a mousemove to refresh the widget */
 			WM_event_add_mousemove(C);
@@ -346,8 +346,8 @@ static int sequencer_backdrop_transform_modal(bContext *C, wmOperator *op, const
 			SpaceSeq *sseq = CTX_wm_space_seq(C);
 			ScrArea *sa = CTX_wm_area(C);
 
-			copy_v2_v2(sseq->backdrop_offset, data->init_offset);
-			sseq->backdrop_zoom = data->init_zoom;
+			copy_v2_v2(sseq->overdrop_offset, data->init_offset);
+			sseq->overdrop_zoom = data->init_zoom;
 			
 			ED_area_headerprint(sa, NULL);
 			WM_widgetgrouptype_unregister(CTX_data_main(C), data->cagetype);
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 7c05a74..1c12f42 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -122,7 +122,7 @@ static SpaceLink *sequencer_new(const bContext *C)
 	sseq->flag = SEQ_SHOW_GPENCIL | SEQ_USE_ALPHA;
 
 	/* backdrop */
-	sseq->backdrop_zoom = 1.0f;
+	sseq->overdrop_zoom = 1.0f;
 	
 	/* header */
 	ar = MEM_callocN(sizeof(ARegion), "header for sequencer");
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 869d081..a54f5db 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -499,8 +499,8 @@ typedef struct SpaceSeq {
 	int view; /* see SEQ_VIEW_* below */
 	int overlay_type;
 	int draw_flag; /* overlay an image of the editing on below the strips */
-	float backdrop_zoom;
-	float backdrop_offset[2];
+	float overdrop_zoom;
+	float overdrop_offset[2];
 
 	struct bGPdata *gpd;        /* grease-pencil data */
 
@@ -519,7 +519,7 @@ typedef enum eSpaceSeq_RegionType {
 
 /* sseq->draw_flag */
 typedef enum eSpaceSeq_DrawFlag {
-	SEQ_DRAW_BACKDROP              = (1 << 0),
+	SEQ_DRAW_OVERDROP              = (1 << 0),
 	SEQ_DRAW_OFFSET_EXT            = (1 << 1),
 } eSpaceSeq_DrawFlag;
 
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 151d45d..4b2c107 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2626,21 +2626,21 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Overlay Type", "Overlay draw type");
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
 
-	prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_BACKDROP);
-	RNA_def_property_ui_text(prop, "Use Backdrop", "Display result under strips");
+	prop = RNA_def_property(srna, "show_overdrop", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "draw_flag", SEQ_DRAW_OVERDROP);
+	RNA_def_property_ui_text(prop, "Use Overdrop", "Display result under strips");
 	RNA_def_property_updat

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list