Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-16 17:40:46 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-16 17:40:46 +0300
commit1e245cc58928ad40c9e665f3aede685a9485ea21 (patch)
treef64cfe137212f0bb93aeb6a545c14c49e6c9b338 /source/blender/blenlib
parent2153c663be809eca6b30fa042c88751692175dc7 (diff)
option to write images to a files on single frame renders, this isn't accessed by the UI at the moment, but could eventually be used for saving test-renders.
The main reason to have this is so renders can be scripted to write to a specific file without having to do annoying tricks like set a dummy start/end frame range, render an animation and work out the current frame image will be written to, then rename after rendering. Also made some 'char *' args into 'const char *'
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_fileops.h2
-rw-r--r--source/blender/blenlib/BLI_path_util.h8
-rw-r--r--source/blender/blenlib/intern/fileops.c2
-rw-r--r--source/blender/blenlib/intern/path_util.c18
-rw-r--r--source/blender/blenlib/intern/storage.c2
5 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h
index 552de7b170c..ecf981c1640 100644
--- a/source/blender/blenlib/BLI_fileops.h
+++ b/source/blender/blenlib/BLI_fileops.h
@@ -47,7 +47,7 @@ int BLI_is_writable(char *filename);
/**
* @attention Do not confuse with BLI_exist
*/
-int BLI_exists(char *file);
+int BLI_exists(const char *file);
int BLI_copy_fileops(char *file, char *to);
int BLI_rename(char *from, char *to);
int BLI_gzip(char *from, char *to);
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h
index cba78e6c8f7..85286d15acb 100644
--- a/source/blender/blenlib/BLI_path_util.h
+++ b/source/blender/blenlib/BLI_path_util.h
@@ -42,9 +42,9 @@ struct direntry;
char *BLI_getDefaultDocumentFolder(void);
-char *BLI_get_folder(int folder_id, char *subfolder);
-char *BLI_get_folder_create(int folder_id, char *subfolder);
-char *BLI_get_user_folder_notest(int folder_id, char *subfolder);
+char *BLI_get_folder(int folder_id, const char *subfolder);
+char *BLI_get_folder_create(int folder_id, const char *subfolder);
+char *BLI_get_user_folder_notest(int folder_id, const char *subfolder);
/* folder_id */
@@ -101,7 +101,7 @@ void BLI_setenv_if_new(const char *env, const char* val);
void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
void BLI_make_exist(char *dir);
-void BLI_make_existing_file(char *name);
+void BLI_make_existing_file(const char *name);
void BLI_split_dirfile(const char *string, char *dir, char *file);
void BLI_join_dirfile(char *string, const char *dir, const char *file);
char *BLI_path_basename(char *path);
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 180cfdbbc5a..931dd6119a2 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -143,7 +143,7 @@ int BLI_touch(const char *file)
return 0;
}
-int BLI_exists(char *file) {
+int BLI_exists(const char *file) {
return BLI_exist(file);
}
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index b6d4d700684..a87617868d1 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -854,7 +854,7 @@ static char *blender_version_decimal(void)
return version_str;
}
-static int test_path(char *targetpath, char *path_base, char *path_sep, char *folder_name)
+static int test_path(char *targetpath, const char *path_base, const char *path_sep, const char *folder_name)
{
char tmppath[FILE_MAX];
@@ -878,7 +878,7 @@ static int test_path(char *targetpath, char *path_base, char *path_sep, char *fo
}
}
-static int test_env_path(char *path, char *envvar)
+static int test_env_path(char *path, const char *envvar)
{
char *env = envvar?getenv(envvar):NULL;
if (!env) return 0;
@@ -892,7 +892,7 @@ static int test_env_path(char *path, char *envvar)
}
}
-static int get_path_local(char *targetpath, char *folder_name, char *subfolder_name)
+static int get_path_local(char *targetpath, const char *folder_name, const char *subfolder_name)
{
extern char bprogname[]; /* argv[0] from creator.c */
char bprogdir[FILE_MAX];
@@ -918,7 +918,7 @@ static int get_path_local(char *targetpath, char *folder_name, char *subfolder_n
return 0;
}
-static int get_path_user(char *targetpath, char *folder_name, char *subfolder_name, char *envvar)
+static int get_path_user(char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar)
{
char user_path[FILE_MAX];
const char *user_base_path;
@@ -955,7 +955,7 @@ static int get_path_user(char *targetpath, char *folder_name, char *subfolder_na
}
}
-static int get_path_system(char *targetpath, char *folder_name, char *subfolder_name, char *envvar)
+static int get_path_system(char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar)
{
char system_path[FILE_MAX];
const char *system_base_path;
@@ -1022,7 +1022,7 @@ static int get_path_system(char *targetpath, char *folder_name, char *subfolder_
/* get a folder out of the 'folder_id' presets for paths */
/* returns the path if found, NULL string if not */
-char *BLI_get_folder(int folder_id, char *subfolder)
+char *BLI_get_folder(int folder_id, const char *subfolder)
{
static char path[FILE_MAX] = "";
@@ -1094,7 +1094,7 @@ char *BLI_get_folder(int folder_id, char *subfolder)
return path;
}
-char *BLI_get_user_folder_notest(int folder_id, char *subfolder)
+char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
{
static char path[FILE_MAX] = "";
@@ -1118,7 +1118,7 @@ char *BLI_get_user_folder_notest(int folder_id, char *subfolder)
return path;
}
-char *BLI_get_folder_create(int folder_id, char *subfolder)
+char *BLI_get_folder_create(int folder_id, const char *subfolder)
{
char *path;
@@ -1226,7 +1226,7 @@ void BLI_make_exist(char *dir) {
}
}
-void BLI_make_existing_file(char *name)
+void BLI_make_existing_file(const char *name)
{
char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE];
diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c
index 5122dea3b8c..7144a7dce34 100644
--- a/source/blender/blenlib/intern/storage.c
+++ b/source/blender/blenlib/intern/storage.c
@@ -474,7 +474,7 @@ int BLI_exist(const char *name)
}
/* would be better in fileops.c except that it needs stat.h so add here */
-int BLI_is_dir(char *file) {
+int BLI_is_dir(const char *file) {
return S_ISDIR(BLI_exist(file));
}