Page MenuHome

Pointcache_filepaths_option03.txt

Pointcache_filepaths_option03.txt

Index: source/blender/blenkernel/intern/pointcache.c
===================================================================
--- source/blender/blenkernel/intern/pointcache.c (revision 14510)
+++ source/blender/blenkernel/intern/pointcache.c (working copy)
@@ -39,6 +39,7 @@
#include "DNA_object_force.h"
#include "DNA_particle_types.h"
#include "DNA_scene_types.h"
+#include "DNA_userdef_types.h"
#include "BLI_blenlib.h"
@@ -167,7 +168,11 @@
static int ptcache_path(PTCacheID *pid, char *filename)
{
Library *lib;
- int i;
+ int i,ul;
+
+ ul = strlen(U.cachedir);
+
+ if (ul > 1)/*so we don't get / */ BLI_add_slash(U.cachedir);
lib= (pid)? pid->ob->id.lib: NULL;
@@ -183,17 +188,22 @@
/* remove .blend */
if (i > 6)
file[i-6] = '\0';
+
+ if (ul > 1) sprintf(filename, "%s%s%s", U.cachedir, PTCACHE_PATH,file);/* add blend file name to pointcache dir */
+ else sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */
- sprintf(filename, "//"PTCACHE_PATH"%s", file); /* add blend file name to pointcache dir */
BLI_add_slash(filename);
BLI_convertstringcode(filename, blendfilename, 0);
+ /*printf("Pcache_path = %s \n",filename);*/
return strlen(filename);
}
/* use the temp path. this is weak but better then not using point cache at all */
/* btempdir is assumed to exist and ALWAYS has a trailing slash */
- sprintf(filename, "%s"PTCACHE_PATH"%d", btempdir, abs(getpid()));
+ if (ul > 1) sprintf(filename, "%s%s%d", U.cachedir, PTCACHE_PATH, abs(getpid()));
+ else sprintf(filename, "%s%s%d", btempdir, PTCACHE_PATH, abs(getpid()));
BLI_add_slash(filename);
+ /*printf("Pcache_path = %s \n",filename);*/
return strlen(filename);
}
Index: source/blender/blenkernel/BKE_pointcache.h
===================================================================
--- source/blender/blenkernel/BKE_pointcache.h (revision 14510)
+++ source/blender/blenkernel/BKE_pointcache.h (working copy)
@@ -30,6 +30,7 @@
#define BKE_POINTCACHE_H
#include "DNA_ID.h"
+#include "DNA_userdef_types.h"
/* Point cache clearing option, for BKE_ptcache_id_clear, before
* and after are non inclusive (they wont remove the cfra) */
Index: source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- source/blender/makesdna/DNA_userdef_types.h (revision 14510)
+++ source/blender/makesdna/DNA_userdef_types.h (working copy)
@@ -165,6 +165,7 @@
char plugseqdir[160];
char pythondir[160];
char sounddir[160];
+ char cachedir[160];
/* yafray: temporary xml export directory */
char yfexportdir[160];
short versions, vrmlflag; // tmp for export, will be replaced by strubi
Index: source/blender/include/blendef.h
===================================================================
--- source/blender/include/blendef.h (revision 14510)
+++ source/blender/include/blendef.h (working copy)
@@ -306,6 +306,7 @@
/* yafray: for exportdir select */
#define B_YAFRAYDIRFILESEL 338
#define B_PYMENUEVAL 339 /* re-eval scripts registration in menus */
+#define B_POINTCACHEFILESEL 340
/* END Definitions for the fileselect buttons in user prefs */
/* IMAGE: 350 */
Index: source/blender/src/space.c
===================================================================
--- source/blender/src/space.c (revision 14510)
+++ source/blender/src/space.c (working copy)
@@ -4288,6 +4288,15 @@
0, 0, 0, 0, 0, "Select the default yafray export directory");
uiBlockEndAlign(block);
+ uiDefBut(block, TEX, 0, "PointCache: ",
+ (xpos+edgsp+lpref+midsp), y2+buth+rspace, lpref-smfileselbut, buth,
+ U.cachedir, 1.0, 63.0, 0, 0,
+ "The default directory for Point Cache files");
+ uiDefIconBut(block, BUT, B_POINTCACHEFILESEL, ICON_FILESEL,
+ (xpos+edgsp+(2*lpref)+midsp-smfileselbut), y2+buth+rspace, smfileselbut, buth,
+ 0, 0, 0, 0, 0, "Select the default Point Cache Directory");
+ uiBlockEndAlign(block);
+
uiBlockBeginAlign(block);
uiDefBut(block, TEX, 0, "Fonts: ",
(xpos+edgsp),y2,(lpref-smfileselbut),buth,
Index: source/blender/src/headerbuttons.c
===================================================================
--- source/blender/src/headerbuttons.c (revision 14510)
+++ source/blender/src/headerbuttons.c (working copy)
@@ -501,6 +501,18 @@
allqueue(REDRAWALL, 0);
}
+static void filesel_u_pointcachedir(char *name)
+{
+ char dir[FILE_MAXDIR], file[FILE_MAXFILE];
+
+ BLI_cleanup_dir(G.sce, name);
+ BLI_split_dirfile(name, dir, file);
+
+ strcpy(U.cachedir, dir);
+ allqueue(REDRAWALL, 0);
+}
+
+
static void filesel_u_plugtexdir(char *name)
{
char dir[FILE_MAXDIR], file[FILE_MAXFILE];
@@ -1449,7 +1461,7 @@
case B_PLAINMENUS: /* is button from space.c *info* */
reset_toolbox();
- break;
+ break;
case B_FLIPINFOMENU: /* is button from space.c *info* */
scrarea_queue_headredraw(curarea);
@@ -1477,7 +1489,15 @@
activate_fileselect(FILE_SPECIAL, "SELECT YFEXPORT PATH", U.yfexportdir, filesel_u_yfexportdir);
break;
-
+
+ case B_POINTCACHEFILESEL: /* is button form space.c *info* */
+ if(curarea->spacetype==SPACE_INFO) {
+ sa= closest_bigger_area();
+ areawinset(sa->win);
+ }
+ activate_fileselect(FILE_SPECIAL, "SELECT POINTCACHE PATH", U.cachedir, filesel_u_pointcachedir);
+ break;
+
case B_FONTDIRFILESEL: /* is button from space.c *info* */
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2b/5d/2173575e2b825136a34ec8332f0d

Event Timeline