[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56626] trunk/blender/source/blender: Changes to footage information panel

Sergey Sharybin sergey.vfx at gmail.com
Thu May 9 16:57:21 CEST 2013


Revision: 56626
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56626
Author:   nazgul
Date:     2013-05-09 14:57:20 +0000 (Thu, 09 May 2013)
Log Message:
-----------
Changes to footage information panel

- Display additional information about channels
  and buffer type (float/byte).
- Don't show frame number beyong sequence length.
- Also fixed issues with footage length calculation,
  so it's pronbably will be needed to reload some
  of existing footages.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/movieclip.c
    trunk/blender/source/blender/editors/space_clip/clip_buttons.c

Modified: trunk/blender/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/movieclip.c	2013-05-09 14:37:32 UTC (rev 56625)
+++ trunk/blender/source/blender/blenkernel/intern/movieclip.c	2013-05-09 14:57:20 UTC (rev 56626)
@@ -299,7 +299,6 @@
 		}
 	}
 	else if (clip->source == MCLIP_SRC_SEQUENCE) {
-		int framenr = 1;
 		unsigned short numlen;
 		char name[FILE_MAX], head[FILE_MAX], tail[FILE_MAX];
 
@@ -307,18 +306,17 @@
 
 		if (numlen == 0) {
 			/* there's no number group in file name, assume it's single framed sequence */
-			clip->len = framenr + 1;
+			clip->len = 1;
 		}
 		else {
+			clip->len = 0;
 			for (;;) {
-				get_sequence_fname(clip, framenr, name);
+				get_sequence_fname(clip, clip->len + clip->start_frame, name);
 
-				if (!BLI_exists(name)) {
-					clip->len = framenr;
+				if (BLI_exists(name))
+					clip->len++;
+				else
 					break;
-				}
-
-				framenr++;
 			}
 		}
 	}

Modified: trunk/blender/source/blender/editors/space_clip/clip_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_buttons.c	2013-05-09 14:37:32 UTC (rev 56625)
+++ trunk/blender/source/blender/editors/space_clip/clip_buttons.c	2013-05-09 14:57:20 UTC (rev 56626)
@@ -64,6 +64,9 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
+#include "IMB_imbuf_types.h"
+#include "IMB_imbuf.h"
+
 #include "clip_intern.h"  /* own include */
 
 /* Panels */
@@ -496,6 +499,8 @@
 	uiLayout *col;
 	char str[1024];
 	int width, height, framenr;
+	ImBuf *ibuf;
+	size_t ofs = 0;
 
 	if (!ptr->data)
 		return;
@@ -519,14 +524,40 @@
 
 	col = uiLayoutColumn(layout, FALSE);
 
-	/* Display frame dimensions. */
+	ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, MOVIECLIP_CACHE_SKIP);
+
+	/* Display frame dimensions, channels number and byffer type. */
 	BKE_movieclip_get_size(clip, user, &width, &height);
-	BLI_snprintf(str, sizeof(str), IFACE_("Size: %dx%d"), width, height);
+	ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, IFACE_("Size %d x %d"), width, height);
+
+	if (ibuf) {
+		if (ibuf->rect_float) {
+			if (ibuf->channels != 4)
+				ofs += BLI_snprintf(str + ofs, sizeof(str) - ofs, IFACE_(", %d float channel(s)"), ibuf->channels);
+			else if (ibuf->planes == R_IMF_PLANES_RGBA)
+				ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGBA float"), sizeof(str) - ofs);
+			else
+				ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGB float"), sizeof(str) - ofs);
+		}
+		else {
+			if (ibuf->planes == R_IMF_PLANES_RGBA)
+				ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGBA byte"), sizeof(str) - ofs);
+			else
+				ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", RGB byte"), sizeof(str) - ofs);
+		}
+	}
+	else {
+		ofs += BLI_strncpy_rlen(str + ofs, IFACE_(", failed to load"), sizeof(str) - ofs);
+	}
+
 	uiItemL(col, str, ICON_NONE);
 
 	/* Display current frame number. */
-	framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr) + clip->frame_offset;
-	BLI_snprintf(str, sizeof(str), IFACE_("Frame: %d"), framenr);
+	framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr) ;
+	if (framenr <= clip->len)
+		BLI_snprintf(str, sizeof(str), IFACE_("Frame: %d / %d"), framenr, clip->len);
+	else
+		BLI_snprintf(str, sizeof(str), IFACE_("Frame: - / %d"), clip->len);
 	uiItemL(col, str, ICON_NONE);
 
 	/* Display current file name if it's a sequence clip. */
@@ -540,4 +571,6 @@
 		BLI_snprintf(str, sizeof(str), IFACE_("File: %s"), file);
 		uiItemL(col, str, ICON_NONE);
 	}
+
+	IMB_freeImBuf(ibuf);
 }




More information about the Bf-blender-cvs mailing list