[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32884] trunk/blender/source/blender: dont change the file paths of sequence images, this is weak design because you can easily have 2 image users with different frame numbers so this ends up being which ever was last loaded .

Campbell Barton ideasman42 at gmail.com
Fri Nov 5 10:01:00 CET 2010


Revision: 32884
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32884
Author:   campbellbarton
Date:     2010-11-05 10:01:00 +0100 (Fri, 05 Nov 2010)

Log Message:
-----------
dont change the file paths of sequence images, this is weak design because you can easily have 2 image users with different frame numbers so this ends up being which ever was last loaded.
Modified to image user template to show the current filename of the image.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/image.c
    trunk/blender/source/blender/editors/space_image/image_buttons.c

Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c	2010-11-05 07:35:21 UTC (rev 32883)
+++ trunk/blender/source/blender/blenkernel/intern/image.c	2010-11-05 09:01:00 UTC (rev 32884)
@@ -1571,15 +1571,10 @@
 /* common stuff to do with images after loading */
 static void image_initialize_after_load(Image *ima, ImBuf *ibuf)
 {
-	
-	
 	/* preview is NULL when it has never been used as an icon before */
 	if(G.background==0 && ima->preview==NULL)
 		BKE_icon_changed(BKE_icon_getid(&ima->id));
-	
-	/* stringcodes also in ibuf, ibuf->name is used to retrieve original (buttons) */
-	BLI_strncpy(ibuf->name, ima->name, FILE_MAX);
-	
+
 	/* fields */
 	if (ima->flag & IMA_FIELDS) {
 		if(ima->flag & IMA_STD_FIELD) de_interlace_st(ibuf);
@@ -1604,11 +1599,10 @@
 		ima->tpageflag |= IMA_TPAGE_REFRESH;
 
 	ima->lastframe= frame;
-
-	BLI_stringdec(ima->name, head, tail, &numlen);
-	BLI_stringenc(ima->name, head, tail, numlen, frame);
 	BLI_strncpy(name, ima->name, sizeof(name));
-	
+	BLI_stringdec(name, head, tail, &numlen);
+	BLI_stringenc(name, head, tail, numlen, frame);
+
 	if(ima->id.lib)
 		BLI_path_abs(name, ima->id.lib->filepath);
 	else
@@ -1753,8 +1747,7 @@
 	return ibuf;
 }
 
-/* cfra used for # code, Image can only have this # for all its users
- * warning, 'iuser' can be NULL */
+/* warning, 'iuser' can be NULL */
 static ImBuf *image_load_image_file(Image *ima, ImageUser *iuser, int cfra)
 {
 	struct ImBuf *ibuf;
@@ -2002,11 +1995,6 @@
 			/* XXX temp stuff? */
 			if(ima->lastframe != frame) {
 				ima->tpageflag |= IMA_TPAGE_REFRESH;
-				if(ibuf) {
-					/* without this the image name only updates
-					 * on first load which is quite confusing */
-					BLI_strncpy(ima->name, ibuf->name, sizeof(ima->name));
-				}
 			}
 			ima->lastframe = frame;
 		}	
@@ -2109,9 +2097,6 @@
 					/* only 1 layer/pass stored in imbufs, no exrhandle anim storage, no saving */
 					ibuf= image_load_sequence_multilayer(ima, iuser, frame);
 				}
-
-				if(ibuf)
-					BLI_strncpy(ima->name, ibuf->name, sizeof(ima->name));
 			}
 			else if(ima->source==IMA_SRC_FILE) {
 				

Modified: trunk/blender/source/blender/editors/space_image/image_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_buttons.c	2010-11-05 07:35:21 UTC (rev 32883)
+++ trunk/blender/source/blender/editors/space_image/image_buttons.c	2010-11-05 09:01:00 UTC (rev 32884)
@@ -137,21 +137,28 @@
 	
 	if(ibuf->rect_float) {
 		if(ibuf->channels!=4) {
-			sprintf(str+ofs, "%d float channel(s)", ibuf->channels);
+			ofs+= sprintf(str+ofs, "%d float channel(s)", ibuf->channels);
 		}
 		else if(ibuf->depth==32)
-			strcat(str, " RGBA float");
+			ofs+= sprintf(str+ofs, " RGBA float");
 		else
-			strcat(str, " RGB float");
+			ofs+= sprintf(str+ofs, " RGB float");
 	}
 	else {
 		if(ibuf->depth==32)
-			strcat(str, " RGBA byte");
+			ofs+= sprintf(str+ofs, " RGBA byte");
 		else
-			strcat(str, " RGB byte");
+			ofs+= sprintf(str+ofs, " RGB byte");
 	}
 	if(ibuf->zbuf || ibuf->zbuf_float)
-		strcat(str, " + Z");
+		ofs+= sprintf(str+ofs, " + Z");
+
+	if(ima->source==IMA_SRC_SEQUENCE) {
+		char *file= BLI_last_slash(ibuf->name);
+		if(file==NULL)	file= ibuf->name;
+		else			file++;
+		sprintf(str+ofs, ", %s", file);
+	}
 	
 }
 





More information about the Bf-blender-cvs mailing list