Page MenuHome

Pointcache_filepaths_option01.txt

Pointcache_filepaths_option01.txt

Index: source/blender/blenkernel/intern/pointcache.c
===================================================================
--- source/blender/blenkernel/intern/pointcache.c (revision 13563)
+++ source/blender/blenkernel/intern/pointcache.c (working copy)
@@ -40,6 +40,8 @@
#include "BKE_global.h"
#include "BKE_library.h"
+#include "DNA_userdef_types.h"
+
#include "BLI_blenlib.h"
#include "BKE_utildefines.h"
#include "blendef.h"
@@ -59,7 +61,7 @@
static int ptcache_path(char *filename)
{
- char dir[FILE_MAX], file[FILE_MAX]; /* we dont want the dir, only the file */
+ char dir[FILE_MAX], file[FILE_MAX], tmp_char[FILE_MAX]; /* we dont want the dir, only the file */
int i;
BLI_split_dirfile(G.sce, dir, file);
@@ -69,7 +71,8 @@
if (i > 6)
file[i-6] = '\0';
- sprintf(filename, PTCACHE_PATH"%s/", file); /* add blend file name to pointcache dir */
+ sprintf(filename, "%s/%s%s/", U.cachedir, PTCACHE_PATH,file);/* add blend file name to pointcache dir */
+
BLI_convertstringcode(filename, G.sce, 0);
return strlen(filename);
}
Index: source/blender/blenkernel/BKE_pointcache.h
===================================================================
--- source/blender/blenkernel/BKE_pointcache.h (revision 13563)
+++ source/blender/blenkernel/BKE_pointcache.h (working copy)
@@ -40,7 +40,7 @@
/* Add the blendfile name after blendcache_ */
#define PTCACHE_EXT ".bphys"
-#define PTCACHE_PATH "//blendcache_"
+#define PTCACHE_PATH "blendcache_"
/* Global funcs */
/* void BKE_ptcache_clean(void); - not implimented yet! */
Index: source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- source/blender/makesdna/DNA_userdef_types.h (revision 13563)
+++ source/blender/makesdna/DNA_userdef_types.h (working copy)
@@ -168,6 +168,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 13563)
+++ source/blender/include/blendef.h (working copy)
@@ -307,6 +307,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 13563)
+++ source/blender/src/space.c (working copy)
@@ -4132,6 +4132,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 13563)
+++ source/blender/src/headerbuttons.c (working copy)
@@ -505,7 +505,17 @@
strcpy(U.textudir, dir);
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];
@@ -1463,7 +1473,16 @@
activate_fileselect(FILE_SPECIAL, "SELECT TEXTURE PATH", U.textudir, filesel_u_textudir);
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_PLUGTEXDIRFILESEL: /* is button form 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
28/7f/fdba6f69e0a435116f39cff1217f

Event Timeline