[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38182] branches/soc-2011-onion/source/ blender/editors/space_view3d/view3d_draw.c: Vertex Weights Export Tool

Antony Riakiotakis kalast at gmail.com
Thu Jul 7 10:10:00 CEST 2011


Revision: 38182
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38182
Author:   psy-fi
Date:     2011-07-07 08:09:58 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Vertex Weights Export Tool
=====================
*Check if file exists and write a new image if it does.

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/editors/space_view3d/view3d_draw.c

Modified: branches/soc-2011-onion/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/space_view3d/view3d_draw.c	2011-07-07 07:13:46 UTC (rev 38181)
+++ branches/soc-2011-onion/source/blender/editors/space_view3d/view3d_draw.c	2011-07-07 08:09:58 UTC (rev 38182)
@@ -2853,7 +2853,14 @@
 		BLI_strncpy(filename, G.main->name, 1024);
 		BLI_parent_dir(filename);
 		BLI_cleanup_dir(NULL, filename);
-		sprintf(imagefile, "%s%s_%s.png",filename, ob->id.name, defgrp->name);
+		i = 0;
+		do{
+			if(i)
+				snprintf(imagefile, 1024, "%s%s_%s.%d.png",filename, ob->id.name, defgrp->name, i-1);
+			else
+				snprintf(imagefile, 1024, "%s%s_%s.png",filename, ob->id.name, defgrp->name);
+			i++;
+		}while(BLI_exists(imagefile));
 		/* cleanup the name so that it contains no illegal characters*/
 		BLI_clean(imagefile);
 		IMB_saveiff(ibuf, imagefile, 0);




More information about the Bf-blender-cvs mailing list