[Bf-blender-cvs] [7823ca0] master: Support metadata display in clip editor

Antony Riakiotakis noreply at git.blender.org
Fri Jun 12 15:26:47 CEST 2015


Commit: 7823ca06da0bd3d2c0eba83f9a98f5b1d1a6db7f
Author: Antony Riakiotakis
Date:   Fri Jun 12 15:25:46 2015 +0200
Branches: master
https://developer.blender.org/rB7823ca06da0bd3d2c0eba83f9a98f5b1d1a6db7f

Support metadata display in clip editor

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

M	release/scripts/startup/bl_ui/space_clip.py
M	source/blender/blenkernel/BKE_blender.h
M	source/blender/blenkernel/intern/movieclip.c
M	source/blender/editors/interface/resources.c
M	source/blender/editors/space_clip/clip_draw.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_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 33943af..ed4a784 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -1156,6 +1156,8 @@ class CLIP_MT_view(Menu):
             layout.operator("clip.view_zoom_out")
 
             layout.separator()
+            layout.prop(sc, "show_metadata")
+            layout.separator()
 
             ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
 
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 21ad505..8367fd4 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
  * and keep comment above the defines.
  * Use STRINGIFY() rather than defining with quotes */
 #define BLENDER_VERSION         275
-#define BLENDER_SUBVERSION      0
+#define BLENDER_SUBVERSION      1
 /* Several breakages with 270, e.g. constraint deg vs rad */
 #define BLENDER_MINVERSION      270
 #define BLENDER_MINSUBVERSION   5
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index f063933..74758ae 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -222,7 +222,7 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user,
 		colorspace = clip->colorspace_settings.name;
 	}
 
-	loadflag = IB_rect | IB_multilayer | IB_alphamode_detect;
+	loadflag = IB_rect | IB_multilayer | IB_alphamode_detect | IB_metadata;
 
 	/* read ibuf */
 	ibuf = IMB_loadiffname(name, loadflag, colorspace);
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 8e7c167..68016ae 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2620,7 +2620,13 @@ void init_userdef_do_versions(void)
 		}
 	}
 
-		
+	if (U.versionfile < 275 || (U.versionfile == 275 && U.subversionfile < 1)) {
+		bTheme *btheme;
+		for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+			copy_v4_v4_char(btheme->tclip.metadatatext, btheme->tseq.text_hi);
+		}
+	}
+
 	if (U.pixelsize == 0.0f)
 		U.pixelsize = 1.0f;
 	
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index ce248f1..76954ed 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -43,6 +43,7 @@
 #include "BLI_math.h"
 #include "BLI_string.h"
 #include "BLI_math_base.h"
+#include "BLI_rect.h"
 
 #include "BKE_context.h"
 #include "BKE_image.h"
@@ -285,6 +286,7 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
 	MovieClip *clip = ED_space_clip_get_clip(sc);
 	int filter = GL_LINEAR;
 	int x, y;
+	rctf frame;
 
 	/* find window pixel coordinates of origin */
 	UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y);
@@ -308,10 +310,14 @@ static void draw_movieclip_buffer(const bContext *C, SpaceClip *sc, ARegion *ar,
 	glPixelZoom(zoomx * width / ibuf->x, zoomy * height / ibuf->y);
 
 	glaDrawImBuf_glsl_ctx(C, ibuf, x, y, filter);
-
 	/* reset zoom */
 	glPixelZoom(1.0f, 1.0f);
 
+	BLI_rctf_init(&frame, 0.0f, ibuf->x, 0.0f, ibuf->y);
+
+	if (sc->flag & SC_SHOW_METADATA)
+		ED_region_image_metadata_draw(x, y, ibuf, frame, zoomx * width / ibuf->x, zoomy * height / ibuf->y);
+
 	if (ibuf->planes == 32)
 		glDisable(GL_BLEND);
 }
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 2098591..9d5b6bb 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -1165,6 +1165,7 @@ typedef enum eSpaceClip_Flag {
 	SC_SHOW_GRAPH_SEL_ONLY      = (1 << 19),
 	SC_SHOW_GRAPH_HIDDEN        = (1 << 20),
 	SC_SHOW_GRAPH_TRACKS_ERROR  = (1 << 21),
+	SC_SHOW_METADATA            = (1 << 22),
 } eSpaceClip_Flag;
 
 /* SpaceClip->mode */
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 5cc768a..8cc6ddc 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -4410,6 +4410,11 @@ static void rna_def_space_clip(BlenderRNA *brna)
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SC_HIDE_DISABLED);
 	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
 
+	prop = RNA_def_property(srna, "show_metadata", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", 	SC_SHOW_METADATA);
+	RNA_def_property_ui_text(prop, "Show Metadata", "Show metadata of clip");
+	RNA_def_property_update(prop, NC_SPACE | ND_SPACE_CLIP, NULL);
+
 	/* scopes */
 	prop = RNA_def_property(srna, "scopes", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "scopes");




More information about the Bf-blender-cvs mailing list