[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12524] trunk/blender/source/blender: * new stamp option to stamp forground sequence strip name.

Campbell Barton cbarton at metavr.com
Thu Nov 8 14:02:59 CET 2007


Revision: 12524
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12524
Author:   campbellbarton
Date:     2007-11-08 14:02:59 +0100 (Thu, 08 Nov 2007)

Log Message:
-----------
* new stamp option to stamp forground sequence strip name.
* made stamp filename optional
* renamed weightpaint "Filter" to "Blur"
* made the defailt weightpaint opacity 1.0 rather then 0.2 so when you select 1.0 weight you can paint it with without multiple clicks.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/include/BIF_editseq.h
    trunk/blender/source/blender/makesdna/DNA_scene_types.h
    trunk/blender/source/blender/src/buttons_editing.c
    trunk/blender/source/blender/src/buttons_scene.c
    trunk/blender/source/blender/src/editcurve.c
    trunk/blender/source/blender/src/editseq.c
    trunk/blender/source/blender/src/vpaint.c

Modified: trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c
===================================================================
--- trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/blenkernel/bad_level_call_stubs/stubs.c	2007-11-08 13:02:59 UTC (rev 12524)
@@ -332,6 +332,9 @@
 /* edittime.c stub */
 TimeMarker *get_frame_marker(int frame){return 0;};
 
+/* editseq.c */
+Sequence *get_forground_frame_seq(int frame){return 0;};
+
 /* modifier.c stub */
 void harmonic_coordinates_bind(struct MeshDeformModifierData *mmd,
 	float (*vertexcos)[3], int totvert, float cagemat[][4]) {}

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2007-11-08 13:02:59 UTC (rev 12524)
@@ -71,6 +71,8 @@
 #include "BKE_texture.h"
 #include "BKE_utildefines.h"
 
+#include "BIF_editseq.h"
+
 #include "PIL_time.h"
 
 #include "RE_pipeline.h"
@@ -777,7 +779,7 @@
 	strcat(string, extension);
 }
 
-/* could allow access externally */
+/* could allow access externally - 512 is for long names, 64 is for id names */
 typedef struct StampData {
 	char 	file[512];
 	char 	note[512];
@@ -785,8 +787,9 @@
 	char 	marker[512];
 	char 	time[512];
 	char 	frame[512];
-	char 	camera[512];
-	char 	scene[512];
+	char 	camera[64];
+	char 	scene[64];
+	char 	strip[64];
 } StampData;
 
 static void stampdata(StampData *stamp_data, int do_prefix)
@@ -800,8 +803,13 @@
 	char sdate[9];
 #endif /* WIN32 */
 	
-	if (do_prefix)		sprintf(stamp_data->file, "File %s", G.sce);
-	else				sprintf(stamp_data->file, "%s", G.sce);
+	if (G.scene->r.stamp & R_STAMP_FILENAME) {
+		if (do_prefix)		sprintf(stamp_data->file, "File %s", G.sce);
+		else				sprintf(stamp_data->file, "%s", G.sce);
+		stamp_data->note[0] = '\0';
+	} else {
+		stamp_data->file[0] = '\0';
+	}
 	
 	if (G.scene->r.stamp & R_STAMP_NOTE) {
 		if (do_prefix)		sprintf(stamp_data->note, "Note %s", G.scene->r.stamp_udata);
@@ -886,6 +894,18 @@
 	} else {
 		stamp_data->scene[0] = '\0';
 	}
+	
+	if (G.scene->r.stamp & R_STAMP_SEQSTRIP) {
+		Sequence *seq = get_forground_frame_seq(CFRA);
+	
+		if (seq) strcpy(text, seq->name+2);
+		else 		strcpy(text, "<none>");
+		
+		if (do_prefix)		sprintf(stamp_data->strip, "Strip %s", text);
+		else				sprintf(stamp_data->strip, "%s", text);
+	} else {
+		stamp_data->strip[0] = '\0';
+	}
 }
 
 void BKE_stamp_buf(unsigned char *rect, float *rectf, int width, int height)
@@ -929,11 +949,11 @@
 	above and below as padding against their backing rectangles */
 	text_pad = BMF_GetStringWidth(font, " ");
 	
-
+	x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */
+	y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */
+	
 	if (stamp_data.file[0]) {
 		/* Top left corner */
-		x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */
-		y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */
 		text_width = BMF_GetStringWidth(font, stamp_data.file);
 		buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
 		BMF_DrawStringBuf(font, stamp_data.file, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height);
@@ -1000,9 +1020,18 @@
 		buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
 		BMF_DrawStringBuf(font, stamp_data.scene, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height);
 	}
+	
+	if (stamp_data.strip[0]) {
+		text_width = BMF_GetStringWidth(font, stamp_data.strip);
+		/* Top right corner */
+		x = width - (text_width+1+text_pad);
+		y = height - font_height - 1;
+		buf_rectfill_area(rect, rectf, width, height, G.scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1);
+		BMF_DrawStringBuf(font, stamp_data.strip, x+(text_pad/2), y, G.scene->r.fg_stamp, rect, rectf, width, height);
+	}
+	
 }
 
-
 void BKE_stamp_info(struct ImBuf *ibuf)
 {
 	struct StampData stamp_data;
@@ -1020,6 +1049,7 @@
 	if (stamp_data.frame[0])	IMB_imginfo_change_field (ibuf, "Frame",	stamp_data.frame);
 	if (stamp_data.camera[0])	IMB_imginfo_change_field (ibuf, "Camera",	stamp_data.camera);
 	if (stamp_data.scene[0])	IMB_imginfo_change_field (ibuf, "Scene",	stamp_data.scene);
+	if (stamp_data.strip[0])	IMB_imginfo_change_field (ibuf, "Strip",	stamp_data.strip);
 }
 
 int BKE_write_ibuf(ImBuf *ibuf, char *name, int imtype, int subimtype, int quality)

Modified: trunk/blender/source/blender/include/BIF_editseq.h
===================================================================
--- trunk/blender/source/blender/include/BIF_editseq.h	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/include/BIF_editseq.h	2007-11-08 13:02:59 UTC (rev 12524)
@@ -44,6 +44,7 @@
 void				update_seq_ipo_rect(struct Sequence * seq);
 void				update_seq_icu_rects(struct Sequence * seq);
 struct Sequence*	get_last_seq();
+struct Sequence*	get_forground_frame_seq( int frame );
 void				set_last_seq(struct Sequence * seq);
 void				clear_last_seq();
 void				del_seq(void);

Modified: trunk/blender/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_scene_types.h	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/makesdna/DNA_scene_types.h	2007-11-08 13:02:59 UTC (rev 12524)
@@ -540,6 +540,8 @@
 #define R_STAMP_NOTE	0x0020
 #define R_STAMP_DRAW	0x0040 /* draw in the image */
 #define R_STAMP_MARKER	0x0080
+#define R_STAMP_FILENAME	0x0100
+#define R_STAMP_SEQSTRIP	0x0200
 
 /* alphamode */
 #define R_ADDSKY		0

Modified: trunk/blender/source/blender/src/buttons_editing.c
===================================================================
--- trunk/blender/source/blender/src/buttons_editing.c	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/src/buttons_editing.c	2007-11-08 13:02:59 UTC (rev 12524)
@@ -5195,7 +5195,7 @@
 	uiDefButS(block, ROW, B_DIFF, "Add",		250,152,60,17, &Gwp.mode, 1.0, 1.0, 0, 0, "Add the vertex colors");
 	uiDefButS(block, ROW, B_DIFF, "Sub",		250,134,60,17, &Gwp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
 	uiDefButS(block, ROW, B_DIFF, "Mul",		250,116,60,17, &Gwp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
-	uiDefButS(block, ROW, B_DIFF, "Filter",		250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Mix the colors with an alpha factor");
+	uiDefButS(block, ROW, B_DIFF, "Blur",		250, 98,60,17, &Gwp.mode, 1.0, 4.0, 0, 0, "Blur the weight with surrounding values");
 	uiDefButS(block, ROW, B_DIFF, "Lighter",	250, 80,60,17, &Gwp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
 	uiDefButS(block, ROW, B_DIFF, "Darker",		250, 62,60,17, &Gwp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
 	uiBlockEndAlign(block);
@@ -5260,7 +5260,7 @@
 		uiDefButS(block, ROW, B_DIFF, "Add",			1212,152,63,17, &Gvp.mode, 1.0, 1.0, 0, 0, "Add the vertex color");
 		uiDefButS(block, ROW, B_DIFF, "Sub",			1212, 134,63,17, &Gvp.mode, 1.0, 2.0, 0, 0, "Subtract from the vertex color");
 		uiDefButS(block, ROW, B_DIFF, "Mul",			1212, 116,63,17, &Gvp.mode, 1.0, 3.0, 0, 0, "Multiply the vertex color");
-		uiDefButS(block, ROW, B_DIFF, "Filter",			1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Mix the colors with an alpha factor");
+		uiDefButS(block, ROW, B_DIFF, "Blur",			1212, 98,63,17, &Gvp.mode, 1.0, 4.0, 0, 0, "Blur the color with surrounding values");
 		uiDefButS(block, ROW, B_DIFF, "Lighter",		1212, 80,63,17, &Gvp.mode, 1.0, 5.0, 0, 0, "Paint over darker areas only");
 		uiDefButS(block, ROW, B_DIFF, "Darker",			1212, 62,63,17, &Gvp.mode, 1.0, 6.0, 0, 0, "Paint over lighter areas only");
 		uiBlockEndAlign(block);

Modified: trunk/blender/source/blender/src/buttons_scene.c
===================================================================
--- trunk/blender/source/blender/src/buttons_scene.c	2007-11-08 09:49:49 UTC (rev 12523)
+++ trunk/blender/source/blender/src/buttons_scene.c	2007-11-08 13:02:59 UTC (rev 12524)
@@ -1540,54 +1540,55 @@
 
 	if (G.scene->r.scemode & R_STAMP_INFO) {
 		uiBlockBeginAlign(block);
-		uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data");
-		uiDefBut(block, TEX, B_NOP, "", xofs+100, yofs, 200, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note");
+		uiDefButBitI(block, TOG, R_STAMP_NOTE, B_REDR, "Note", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp user data");
+		uiDefBut(block, TEX, B_NOP, "", xofs+120, yofs, 180, 19, &G.scene->r.stamp_udata, 0.0, 128.0, 100, 0, "User Note");
 		uiBlockEndAlign(block);
 		yofs += 30; /* gap */
 		
 		
-		yofs += 100;
-		// Order is important for alligning ... grr
+		yofs += 80;
+ 		/* Order is important for alligning ... grr */
 		uiBlockBeginAlign(block);
-		uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name");
+		uiDefButBitI(block, TOG, R_STAMP_FILENAME, B_REDR, "Filename", xofs, yofs, 120, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp blend filename");
 		yofs -= 20;
-		uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name");
+		uiDefButBitI(block, TOG, R_STAMP_SCENE, B_REDR, "Scene", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp scene name");
+		uiDefButBitI(block, TOG, R_STAMP_CAMERA, B_REDR, "Camera", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp camera name");
 		yofs -= 20;
-		uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date");
+		uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)");
+		uiDefButBitI(block, TOG, R_STAMP_DATE, B_REDR, "Date", xofs+60, yofs, 60, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp date");
 		yofs -= 20;
-		uiDefButBitI(block, TOG, R_STAMP_TIME, B_REDR, "Time", xofs, yofs, 100, 19, &G.scene->r.stamp, 0, 0, 0, 0, "Stamp time (HH:MM:SS)");

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list