forked from bartvdbraak/blender
Merge branch 'master' into blender2.8
This commit is contained in:
commit
56173e512c
@ -217,7 +217,7 @@ bool BKE_cachefile_filepath_get(
|
|||||||
char ext[32];
|
char ext[32];
|
||||||
BLI_path_frame_strip(r_filepath, true, ext);
|
BLI_path_frame_strip(r_filepath, true, ext);
|
||||||
BLI_path_frame(r_filepath, frame, frame_len);
|
BLI_path_frame(r_filepath, frame, frame_len);
|
||||||
BLI_ensure_extension(r_filepath, FILE_MAX, ext);
|
BLI_path_extension_ensure(r_filepath, FILE_MAX, ext);
|
||||||
|
|
||||||
/* TODO(kevin): store sequence range? */
|
/* TODO(kevin): store sequence range? */
|
||||||
return BLI_exists(r_filepath);
|
return BLI_exists(r_filepath);
|
||||||
|
@ -576,7 +576,7 @@ static void image_init_color_management(Image *ima)
|
|||||||
|
|
||||||
char BKE_image_alpha_mode_from_extension_ex(const char *filepath)
|
char BKE_image_alpha_mode_from_extension_ex(const char *filepath)
|
||||||
{
|
{
|
||||||
if (BLI_testextensie_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) {
|
if (BLI_path_extension_check_n(filepath, ".exr", ".cin", ".dpx", ".hdr", NULL)) {
|
||||||
return IMA_ALPHA_PREMUL;
|
return IMA_ALPHA_PREMUL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -607,7 +607,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath)
|
|||||||
ima = image_alloc(bmain, BLI_path_basename(filepath), IMA_SRC_FILE, IMA_TYPE_IMAGE);
|
ima = image_alloc(bmain, BLI_path_basename(filepath), IMA_SRC_FILE, IMA_TYPE_IMAGE);
|
||||||
STRNCPY(ima->name, filepath);
|
STRNCPY(ima->name, filepath);
|
||||||
|
|
||||||
if (BLI_testextensie_array(filepath, imb_ext_movie))
|
if (BLI_path_extension_check_array(filepath, imb_ext_movie))
|
||||||
ima->source = IMA_SRC_MOVIE;
|
ima->source = IMA_SRC_MOVIE;
|
||||||
|
|
||||||
image_init_color_management(ima);
|
image_init_color_management(ima);
|
||||||
@ -1352,63 +1352,63 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
|
|||||||
(void)im_format; /* may be unused, depends on build options */
|
(void)im_format; /* may be unused, depends on build options */
|
||||||
|
|
||||||
if (imtype == R_IMF_IMTYPE_IRIS) {
|
if (imtype == R_IMF_IMTYPE_IRIS) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".rgb"))
|
if (!BLI_path_extension_check(string, extension_test = ".rgb"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
else if (imtype == R_IMF_IMTYPE_IRIZ) {
|
else if (imtype == R_IMF_IMTYPE_IRIZ) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".rgb"))
|
if (!BLI_path_extension_check(string, extension_test = ".rgb"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#ifdef WITH_HDR
|
#ifdef WITH_HDR
|
||||||
else if (imtype == R_IMF_IMTYPE_RADHDR) {
|
else if (imtype == R_IMF_IMTYPE_RADHDR) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".hdr"))
|
if (!BLI_path_extension_check(string, extension_test = ".hdr"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
|
else if (ELEM(imtype, R_IMF_IMTYPE_PNG, R_IMF_IMTYPE_FFMPEG, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID)) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".png"))
|
if (!BLI_path_extension_check(string, extension_test = ".png"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#ifdef WITH_DDS
|
#ifdef WITH_DDS
|
||||||
else if (imtype == R_IMF_IMTYPE_DDS) {
|
else if (imtype == R_IMF_IMTYPE_DDS) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".dds"))
|
if (!BLI_path_extension_check(string, extension_test = ".dds"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else if (ELEM(imtype, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_RAWTGA)) {
|
else if (ELEM(imtype, R_IMF_IMTYPE_TARGA, R_IMF_IMTYPE_RAWTGA)) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".tga"))
|
if (!BLI_path_extension_check(string, extension_test = ".tga"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
else if (imtype == R_IMF_IMTYPE_BMP) {
|
else if (imtype == R_IMF_IMTYPE_BMP) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".bmp"))
|
if (!BLI_path_extension_check(string, extension_test = ".bmp"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#ifdef WITH_TIFF
|
#ifdef WITH_TIFF
|
||||||
else if (imtype == R_IMF_IMTYPE_TIFF) {
|
else if (imtype == R_IMF_IMTYPE_TIFF) {
|
||||||
if (!BLI_testextensie_n(string, extension_test = ".tif", ".tiff", NULL)) {
|
if (!BLI_path_extension_check_n(string, extension_test = ".tif", ".tiff", NULL)) {
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_OPENIMAGEIO
|
#ifdef WITH_OPENIMAGEIO
|
||||||
else if (imtype == R_IMF_IMTYPE_PSD) {
|
else if (imtype == R_IMF_IMTYPE_PSD) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".psd"))
|
if (!BLI_path_extension_check(string, extension_test = ".psd"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_OPENEXR
|
#ifdef WITH_OPENEXR
|
||||||
else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER) {
|
else if (imtype == R_IMF_IMTYPE_OPENEXR || imtype == R_IMF_IMTYPE_MULTILAYER) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".exr"))
|
if (!BLI_path_extension_check(string, extension_test = ".exr"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_CINEON
|
#ifdef WITH_CINEON
|
||||||
else if (imtype == R_IMF_IMTYPE_CINEON) {
|
else if (imtype == R_IMF_IMTYPE_CINEON) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".cin"))
|
if (!BLI_path_extension_check(string, extension_test = ".cin"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
else if (imtype == R_IMF_IMTYPE_DPX) {
|
else if (imtype == R_IMF_IMTYPE_DPX) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".dpx"))
|
if (!BLI_path_extension_check(string, extension_test = ".dpx"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1416,35 +1416,35 @@ static bool do_add_image_extension(char *string, const char imtype, const ImageF
|
|||||||
else if (imtype == R_IMF_IMTYPE_JP2) {
|
else if (imtype == R_IMF_IMTYPE_JP2) {
|
||||||
if (im_format) {
|
if (im_format) {
|
||||||
if (im_format->jp2_codec == R_IMF_JP2_CODEC_JP2) {
|
if (im_format->jp2_codec == R_IMF_JP2_CODEC_JP2) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".jp2"))
|
if (!BLI_path_extension_check(string, extension_test = ".jp2"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
else if (im_format->jp2_codec == R_IMF_JP2_CODEC_J2K) {
|
else if (im_format->jp2_codec == R_IMF_JP2_CODEC_J2K) {
|
||||||
if (!BLI_testextensie(string, extension_test = ".j2c"))
|
if (!BLI_path_extension_check(string, extension_test = ".j2c"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
BLI_assert(!"Unsupported jp2 codec was specified in im_format->jp2_codec");
|
BLI_assert(!"Unsupported jp2 codec was specified in im_format->jp2_codec");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!BLI_testextensie(string, extension_test = ".jp2"))
|
if (!BLI_path_extension_check(string, extension_test = ".jp2"))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc
|
else { // R_IMF_IMTYPE_AVIRAW, R_IMF_IMTYPE_AVIJPEG, R_IMF_IMTYPE_JPEG90 etc
|
||||||
if (!(BLI_testextensie_n(string, extension_test = ".jpg", ".jpeg", NULL)))
|
if (!(BLI_path_extension_check_n(string, extension_test = ".jpg", ".jpeg", NULL)))
|
||||||
extension = extension_test;
|
extension = extension_test;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extension) {
|
if (extension) {
|
||||||
/* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
|
/* prefer this in many cases to avoid .png.tga, but in certain cases it breaks */
|
||||||
/* remove any other known image extension */
|
/* remove any other known image extension */
|
||||||
if (BLI_testextensie_array(string, imb_ext_image)) {
|
if (BLI_path_extension_check_array(string, imb_ext_image)) {
|
||||||
return BLI_replace_extension(string, FILE_MAX, extension);
|
return BLI_path_extension_replace(string, FILE_MAX, extension);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return BLI_ensure_extension(string, FILE_MAX, extension);
|
return BLI_path_extension_ensure(string, FILE_MAX, extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -3028,7 +3028,7 @@ bool BKE_image_is_openexr(struct Image *ima)
|
|||||||
{
|
{
|
||||||
#ifdef WITH_OPENEXR
|
#ifdef WITH_OPENEXR
|
||||||
if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) {
|
if (ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_SEQUENCE)) {
|
||||||
return BLI_testextensie(ima->name, ".exr");
|
return BLI_path_extension_check(ima->name, ".exr");
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
UNUSED_VARS(ima);
|
UNUSED_VARS(ima);
|
||||||
|
@ -549,7 +549,7 @@ static void studiolight_add_files_from_datafolder(const int folder_id, const cha
|
|||||||
if ((dir[i].type & S_IFREG)) {
|
if ((dir[i].type & S_IFREG)) {
|
||||||
const char *filename = dir[i].relname;
|
const char *filename = dir[i].relname;
|
||||||
const char *path = dir[i].path;
|
const char *path = dir[i].path;
|
||||||
if (BLI_testextensie_array(filename, imb_ext_image)) {
|
if (BLI_path_extension_check_array(filename, imb_ext_image)) {
|
||||||
sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | flag);
|
sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | flag);
|
||||||
BLI_strncpy(sl->name, filename, FILE_MAXFILE);
|
BLI_strncpy(sl->name, filename, FILE_MAXFILE);
|
||||||
BLI_strncpy(sl->path, path, FILE_MAXFILE);
|
BLI_strncpy(sl->path, path, FILE_MAXFILE);
|
||||||
|
@ -150,7 +150,7 @@ static void filepath_avi(char *string, RenderData *rd, bool preview, const char
|
|||||||
BLI_make_existing_file(string);
|
BLI_make_existing_file(string);
|
||||||
|
|
||||||
if (rd->scemode & R_EXTENSION) {
|
if (rd->scemode & R_EXTENSION) {
|
||||||
if (!BLI_testextensie(string, ".avi")) {
|
if (!BLI_path_extension_check(string, ".avi")) {
|
||||||
BLI_path_frame_range(string, sfra, efra, 4);
|
BLI_path_frame_range(string, sfra, efra, 4);
|
||||||
strcat(string, ".avi");
|
strcat(string, ".avi");
|
||||||
}
|
}
|
||||||
|
@ -81,12 +81,12 @@ bool BLI_path_program_extensions_add_win32(char *name, const size_t maxlen);
|
|||||||
#endif
|
#endif
|
||||||
bool BLI_path_program_search(char *fullname, const size_t maxlen, const char *name);
|
bool BLI_path_program_search(char *fullname, const size_t maxlen, const char *name);
|
||||||
|
|
||||||
bool BLI_testextensie(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
bool BLI_path_extension_check(const char *str, const char *ext) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
||||||
bool BLI_testextensie_n(const char *str, ...) ATTR_NONNULL(1) ATTR_SENTINEL(0);
|
bool BLI_path_extension_check_n(const char *str, ...) ATTR_NONNULL(1) ATTR_SENTINEL(0);
|
||||||
bool BLI_testextensie_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
bool BLI_path_extension_check_array(const char *str, const char **ext_array) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
||||||
bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
|
||||||
bool BLI_replace_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
|
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
|
||||||
bool BLI_ensure_extension(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
|
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
|
||||||
bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
|
bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
|
||||||
int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
|
int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
|
||||||
void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
|
void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
|
||||||
|
@ -703,7 +703,7 @@ bool BLI_parent_dir(char *path)
|
|||||||
BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
|
BLI_join_dirfile(tmp, sizeof(tmp), path, parent_dir);
|
||||||
BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
|
BLI_cleanup_dir(NULL, tmp); /* does all the work of normalizing the path for us */
|
||||||
|
|
||||||
if (!BLI_testextensie(tmp, parent_dir)) {
|
if (!BLI_path_extension_check(tmp, parent_dir)) {
|
||||||
strcpy(path, tmp); /* We assume pardir is always shorter... */
|
strcpy(path, tmp); /* We assume pardir is always shorter... */
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1353,7 +1353,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, c
|
|||||||
BLI_path_native_slash(string);
|
BLI_path_native_slash(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool testextensie_ex(const char *str, const size_t str_len,
|
static bool path_extension_check_ex(const char *str, const size_t str_len,
|
||||||
const char *ext, const size_t ext_len)
|
const char *ext, const size_t ext_len)
|
||||||
{
|
{
|
||||||
BLI_assert(strlen(str) == str_len);
|
BLI_assert(strlen(str) == str_len);
|
||||||
@ -1364,12 +1364,12 @@ static bool testextensie_ex(const char *str, const size_t str_len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* does str end with ext. */
|
/* does str end with ext. */
|
||||||
bool BLI_testextensie(const char *str, const char *ext)
|
bool BLI_path_extension_check(const char *str, const char *ext)
|
||||||
{
|
{
|
||||||
return testextensie_ex(str, strlen(str), ext, strlen(ext));
|
return path_extension_check_ex(str, strlen(str), ext, strlen(ext));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BLI_testextensie_n(const char *str, ...)
|
bool BLI_path_extension_check_n(const char *str, ...)
|
||||||
{
|
{
|
||||||
const size_t str_len = strlen(str);
|
const size_t str_len = strlen(str);
|
||||||
|
|
||||||
@ -1380,7 +1380,7 @@ bool BLI_testextensie_n(const char *str, ...)
|
|||||||
va_start(args, str);
|
va_start(args, str);
|
||||||
|
|
||||||
while ((ext = (const char *) va_arg(args, void *))) {
|
while ((ext = (const char *) va_arg(args, void *))) {
|
||||||
if (testextensie_ex(str, str_len, ext, strlen(ext))) {
|
if (path_extension_check_ex(str, str_len, ext, strlen(ext))) {
|
||||||
ret = true;
|
ret = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1392,13 +1392,13 @@ bool BLI_testextensie_n(const char *str, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* does str end with any of the suffixes in *ext_array. */
|
/* does str end with any of the suffixes in *ext_array. */
|
||||||
bool BLI_testextensie_array(const char *str, const char **ext_array)
|
bool BLI_path_extension_check_array(const char *str, const char **ext_array)
|
||||||
{
|
{
|
||||||
const size_t str_len = strlen(str);
|
const size_t str_len = strlen(str);
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (ext_array[i]) {
|
while (ext_array[i]) {
|
||||||
if (testextensie_ex(str, str_len, ext_array[i], strlen(ext_array[i]))) {
|
if (path_extension_check_ex(str, str_len, ext_array[i], strlen(ext_array[i]))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1412,7 +1412,7 @@ bool BLI_testextensie_array(const char *str, const char **ext_array)
|
|||||||
* '*.zip;*.py;*.exe'
|
* '*.zip;*.py;*.exe'
|
||||||
* does str match any of the semicolon-separated glob patterns in fnmatch.
|
* does str match any of the semicolon-separated glob patterns in fnmatch.
|
||||||
*/
|
*/
|
||||||
bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
|
bool BLI_path_extension_check_glob(const char *str, const char *ext_fnmatch)
|
||||||
{
|
{
|
||||||
const char *ext_step = ext_fnmatch;
|
const char *ext_step = ext_fnmatch;
|
||||||
char pattern[16];
|
char pattern[16];
|
||||||
@ -1443,7 +1443,7 @@ bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch)
|
|||||||
* Removes any existing extension on the end of \a path and appends \a ext.
|
* Removes any existing extension on the end of \a path and appends \a ext.
|
||||||
* \return false if there was no room.
|
* \return false if there was no room.
|
||||||
*/
|
*/
|
||||||
bool BLI_replace_extension(char *path, size_t maxlen, const char *ext)
|
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_STRSIZE
|
#ifdef DEBUG_STRSIZE
|
||||||
memset(path, 0xff, sizeof(*path) * maxlen);
|
memset(path, 0xff, sizeof(*path) * maxlen);
|
||||||
@ -1472,7 +1472,7 @@ bool BLI_replace_extension(char *path, size_t maxlen, const char *ext)
|
|||||||
/**
|
/**
|
||||||
* Strip's trailing '.'s and adds the extension only when needed
|
* Strip's trailing '.'s and adds the extension only when needed
|
||||||
*/
|
*/
|
||||||
bool BLI_ensure_extension(char *path, size_t maxlen, const char *ext)
|
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_STRSIZE
|
#ifdef DEBUG_STRSIZE
|
||||||
memset(path, 0xff, sizeof(*path) * maxlen);
|
memset(path, 0xff, sizeof(*path) * maxlen);
|
||||||
|
@ -1368,7 +1368,7 @@ void blo_freefiledata(FileData *fd)
|
|||||||
bool BLO_has_bfile_extension(const char *str)
|
bool BLO_has_bfile_extension(const char *str)
|
||||||
{
|
{
|
||||||
const char *ext_test[4] = {".blend", ".ble", ".blend.gz", NULL};
|
const char *ext_test[4] = {".blend", ".ble", ".blend.gz", NULL};
|
||||||
return BLI_testextensie_array(str, ext_test);
|
return BLI_path_extension_check_array(str, ext_test);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,7 +168,7 @@ static COLLADABU::NativeString make_temp_filepath(const char *name, const char *
|
|||||||
BLI_make_file_string(NULL, tempfile, tempdir, name);
|
BLI_make_file_string(NULL, tempfile, tempdir, name);
|
||||||
|
|
||||||
if (extension) {
|
if (extension) {
|
||||||
BLI_ensure_extension(tempfile, FILE_MAX, extension);
|
BLI_path_extension_ensure(tempfile, FILE_MAX, extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
COLLADABU::NativeString native_filename =
|
COLLADABU::NativeString native_filename =
|
||||||
|
@ -602,7 +602,7 @@ static void init_iconfile_list(struct ListBase *list)
|
|||||||
if ((dir[i].type & S_IFREG)) {
|
if ((dir[i].type & S_IFREG)) {
|
||||||
const char *filename = dir[i].relname;
|
const char *filename = dir[i].relname;
|
||||||
|
|
||||||
if (BLI_testextensie(filename, ".png")) {
|
if (BLI_path_extension_check(filename, ".png")) {
|
||||||
/* loading all icons on file start is overkill & slows startup
|
/* loading all icons on file start is overkill & slows startup
|
||||||
* its possible they change size after blender load anyway. */
|
* its possible they change size after blender load anyway. */
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -86,7 +86,7 @@ static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *
|
|||||||
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
||||||
}
|
}
|
||||||
|
|
||||||
BLI_replace_extension(filepath, sizeof(filepath), ".abc");
|
BLI_path_extension_replace(filepath, sizeof(filepath), ".abc");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,8 +284,8 @@ static bool wm_alembic_export_check(bContext *UNUSED(C), wmOperator *op)
|
|||||||
char filepath[FILE_MAX];
|
char filepath[FILE_MAX];
|
||||||
RNA_string_get(op->ptr, "filepath", filepath);
|
RNA_string_get(op->ptr, "filepath", filepath);
|
||||||
|
|
||||||
if (!BLI_testextensie(filepath, ".abc")) {
|
if (!BLI_path_extension_check(filepath, ".abc")) {
|
||||||
BLI_ensure_extension(filepath, FILE_MAX, ".abc");
|
BLI_path_extension_ensure(filepath, FILE_MAX, ".abc");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ static int cachefile_open_invoke(bContext *C, wmOperator *op, const wmEvent *eve
|
|||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
|
|
||||||
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
||||||
BLI_replace_extension(filepath, sizeof(filepath), ".abc");
|
BLI_path_extension_replace(filepath, sizeof(filepath), ".abc");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent *
|
|||||||
else
|
else
|
||||||
BLI_strncpy(filepath, blendfile_path, sizeof(filepath));
|
BLI_strncpy(filepath, blendfile_path, sizeof(filepath));
|
||||||
|
|
||||||
BLI_replace_extension(filepath, sizeof(filepath), ".dae");
|
BLI_path_extension_replace(filepath, sizeof(filepath), ".dae");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RNA_string_get(op->ptr, "filepath", filepath);
|
RNA_string_get(op->ptr, "filepath", filepath);
|
||||||
BLI_ensure_extension(filepath, sizeof(filepath), ".dae");
|
BLI_path_extension_ensure(filepath, sizeof(filepath), ".dae");
|
||||||
|
|
||||||
|
|
||||||
/* Avoid File write exceptions in Collada */
|
/* Avoid File write exceptions in Collada */
|
||||||
@ -337,8 +337,8 @@ static bool wm_collada_export_check(bContext *UNUSED(C), wmOperator *op)
|
|||||||
char filepath[FILE_MAX];
|
char filepath[FILE_MAX];
|
||||||
RNA_string_get(op->ptr, "filepath", filepath);
|
RNA_string_get(op->ptr, "filepath", filepath);
|
||||||
|
|
||||||
if (!BLI_testextensie(filepath, ".dae")) {
|
if (!BLI_path_extension_check(filepath, ".dae")) {
|
||||||
BLI_ensure_extension(filepath, FILE_MAX, ".dae");
|
BLI_path_extension_ensure(filepath, FILE_MAX, ".dae");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ static int screenshot_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(
|
|||||||
char filepath[FILE_MAX] = "//screen";
|
char filepath[FILE_MAX] = "//screen";
|
||||||
if (G.relbase_valid) {
|
if (G.relbase_valid) {
|
||||||
BLI_strncpy(filepath, BKE_main_blendfile_path_from_global(), sizeof(filepath));
|
BLI_strncpy(filepath, BKE_main_blendfile_path_from_global(), sizeof(filepath));
|
||||||
BLI_replace_extension(filepath, sizeof(filepath), ""); /* strip '.blend' */
|
BLI_path_extension_replace(filepath, sizeof(filepath), ""); /* strip '.blend' */
|
||||||
}
|
}
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
|
|
||||||
|
@ -455,10 +455,10 @@ static bool sound_mixdown_check(bContext *UNUSED(C), wmOperator *op)
|
|||||||
prop = RNA_struct_find_property(op->ptr, "filepath");
|
prop = RNA_struct_find_property(op->ptr, "filepath");
|
||||||
RNA_property_string_get(op->ptr, prop, filepath);
|
RNA_property_string_get(op->ptr, prop, filepath);
|
||||||
|
|
||||||
if (BLI_testextensie_array(filepath, snd_ext_sound))
|
if (BLI_path_extension_check_array(filepath, snd_ext_sound))
|
||||||
check = BLI_replace_extension(filepath, FILE_MAX, extension);
|
check = BLI_path_extension_replace(filepath, FILE_MAX, extension);
|
||||||
else
|
else
|
||||||
check = BLI_ensure_extension(filepath, FILE_MAX, extension);
|
check = BLI_path_extension_ensure(filepath, FILE_MAX, extension);
|
||||||
|
|
||||||
if (!check)
|
if (!check)
|
||||||
return check;
|
return check;
|
||||||
|
@ -1973,31 +1973,31 @@ int ED_path_extension_type(const char *path)
|
|||||||
else if (file_is_blend_backup(path)) {
|
else if (file_is_blend_backup(path)) {
|
||||||
return FILE_TYPE_BLENDER_BACKUP;
|
return FILE_TYPE_BLENDER_BACKUP;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".app")) {
|
else if (BLI_path_extension_check(path, ".app")) {
|
||||||
return FILE_TYPE_APPLICATIONBUNDLE;
|
return FILE_TYPE_APPLICATIONBUNDLE;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".py")) {
|
else if (BLI_path_extension_check(path, ".py")) {
|
||||||
return FILE_TYPE_PYSCRIPT;
|
return FILE_TYPE_PYSCRIPT;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) {
|
else if (BLI_path_extension_check_n(path, ".txt", ".glsl", ".osl", ".data", ".pov", ".ini", ".mcr", ".inc", NULL)) {
|
||||||
return FILE_TYPE_TEXT;
|
return FILE_TYPE_TEXT;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) {
|
else if (BLI_path_extension_check_n(path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", NULL)) {
|
||||||
return FILE_TYPE_FTFONT;
|
return FILE_TYPE_FTFONT;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".btx")) {
|
else if (BLI_path_extension_check(path, ".btx")) {
|
||||||
return FILE_TYPE_BTX;
|
return FILE_TYPE_BTX;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".dae")) {
|
else if (BLI_path_extension_check(path, ".dae")) {
|
||||||
return FILE_TYPE_COLLADA;
|
return FILE_TYPE_COLLADA;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".abc")) {
|
else if (BLI_path_extension_check(path, ".abc")) {
|
||||||
return FILE_TYPE_ALEMBIC;
|
return FILE_TYPE_ALEMBIC;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie_array(path, imb_ext_image)) {
|
else if (BLI_path_extension_check_array(path, imb_ext_image)) {
|
||||||
return FILE_TYPE_IMAGE;
|
return FILE_TYPE_IMAGE;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie(path, ".ogg")) {
|
else if (BLI_path_extension_check(path, ".ogg")) {
|
||||||
if (IMB_isanim(path)) {
|
if (IMB_isanim(path)) {
|
||||||
return FILE_TYPE_MOVIE;
|
return FILE_TYPE_MOVIE;
|
||||||
}
|
}
|
||||||
@ -2005,10 +2005,10 @@ int ED_path_extension_type(const char *path)
|
|||||||
return FILE_TYPE_SOUND;
|
return FILE_TYPE_SOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie_array(path, imb_ext_movie)) {
|
else if (BLI_path_extension_check_array(path, imb_ext_movie)) {
|
||||||
return FILE_TYPE_MOVIE;
|
return FILE_TYPE_MOVIE;
|
||||||
}
|
}
|
||||||
else if (BLI_testextensie_array(path, imb_ext_audio)) {
|
else if (BLI_path_extension_check_array(path, imb_ext_audio)) {
|
||||||
return FILE_TYPE_SOUND;
|
return FILE_TYPE_SOUND;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2233,7 +2233,7 @@ static int filelist_readjob_list_dir(
|
|||||||
/* Otherwise, do not check extensions for directories! */
|
/* Otherwise, do not check extensions for directories! */
|
||||||
else if (!(entry->typeflag & FILE_TYPE_DIR)) {
|
else if (!(entry->typeflag & FILE_TYPE_DIR)) {
|
||||||
entry->typeflag = file_extension_type(root, entry->relpath);
|
entry->typeflag = file_extension_type(root, entry->relpath);
|
||||||
if (filter_glob[0] && BLI_testextensie_glob(entry->relpath, filter_glob)) {
|
if (filter_glob[0] && BLI_path_extension_check_glob(entry->relpath, filter_glob)) {
|
||||||
entry->typeflag |= FILE_TYPE_OPERATOR;
|
entry->typeflag |= FILE_TYPE_OPERATOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1538,7 +1538,7 @@ static int image_replace_exec(bContext *C, wmOperator *op)
|
|||||||
BKE_image_signal(bmain, sima->image, &sima->iuser, IMA_SIGNAL_SRC_CHANGE);
|
BKE_image_signal(bmain, sima->image, &sima->iuser, IMA_SIGNAL_SRC_CHANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BLI_testextensie_array(str, imb_ext_movie))
|
if (BLI_path_extension_check_array(str, imb_ext_movie))
|
||||||
sima->image->source = IMA_SRC_MOVIE;
|
sima->image->source = IMA_SRC_MOVIE;
|
||||||
else
|
else
|
||||||
sima->image->source = IMA_SRC_FILE;
|
sima->image->source = IMA_SRC_FILE;
|
||||||
|
@ -3874,7 +3874,7 @@ static int sequencer_export_subtitles_invoke(bContext *C, wmOperator *op, const
|
|||||||
else
|
else
|
||||||
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
BLI_strncpy(filepath, BKE_main_blendfile_path(bmain), sizeof(filepath));
|
||||||
|
|
||||||
BLI_replace_extension(filepath, sizeof(filepath), ".srt");
|
BLI_path_extension_replace(filepath, sizeof(filepath), ".srt");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3899,7 +3899,7 @@ static int sequencer_export_subtitles_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
RNA_string_get(op->ptr, "filepath", filepath);
|
RNA_string_get(op->ptr, "filepath", filepath);
|
||||||
BLI_ensure_extension(filepath, sizeof(filepath), ".srt");
|
BLI_path_extension_ensure(filepath, sizeof(filepath), ".srt");
|
||||||
|
|
||||||
/* Avoid File write exceptions */
|
/* Avoid File write exceptions */
|
||||||
if (!BLI_exists(filepath)) {
|
if (!BLI_exists(filepath)) {
|
||||||
|
@ -928,7 +928,7 @@ Render *Controller::RenderStrokes(Render *re, bool render)
|
|||||||
|
|
||||||
void Controller::InsertStyleModule(unsigned index, const char *iFileName)
|
void Controller::InsertStyleModule(unsigned index, const char *iFileName)
|
||||||
{
|
{
|
||||||
if (!BLI_testextensie(iFileName, ".py")) {
|
if (!BLI_path_extension_check(iFileName, ".py")) {
|
||||||
cerr << "Error: Cannot load \"" << string(iFileName) << "\", unknown extension" << endl;
|
cerr << "Error: Cannot load \"" << string(iFileName) << "\", unknown extension" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ int imb_is_a_photoshop(const char *filename)
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
return BLI_testextensie_array(filename, photoshop_extension);
|
return BLI_path_extension_check_array(filename, photoshop_extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags)
|
int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags)
|
||||||
|
@ -159,7 +159,7 @@ static ImBuf *IMB_ibImageFromFile(const char *filepath, int flags, char colorspa
|
|||||||
static bool imb_is_filepath_format(const char *filepath)
|
static bool imb_is_filepath_format(const char *filepath)
|
||||||
{
|
{
|
||||||
/* return true if this is one of the formats that can't be loaded from memory */
|
/* return true if this is one of the formats that can't be loaded from memory */
|
||||||
return BLI_testextensie_array(filepath, imb_ext_image_filepath_only);
|
return BLI_path_extension_check_array(filepath, imb_ext_image_filepath_only);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImBuf *IMB_loadifffile(int file, const char *filepath, int flags, char colorspace[IM_MAX_SPACE], const char *descr)
|
ImBuf *IMB_loadifffile(int file, const char *filepath, int flags, char colorspace[IM_MAX_SPACE], const char *descr)
|
||||||
@ -199,7 +199,7 @@ static void imb_cache_filename(char *filename, const char *name, int flags)
|
|||||||
/* read .tx instead if it exists and is not older */
|
/* read .tx instead if it exists and is not older */
|
||||||
if (flags & IB_tilecache) {
|
if (flags & IB_tilecache) {
|
||||||
BLI_strncpy(filename, name, IMB_FILENAME_SIZE);
|
BLI_strncpy(filename, name, IMB_FILENAME_SIZE);
|
||||||
if (!BLI_replace_extension(filename, IMB_FILENAME_SIZE, ".tx"))
|
if (!BLI_path_extension_replace(filename, IMB_FILENAME_SIZE, ".tx"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BLI_file_older(name, filename))
|
if (BLI_file_older(name, filename))
|
||||||
|
@ -281,7 +281,7 @@ static int isffmpeg(const char *filename)
|
|||||||
AVCodec *pCodec;
|
AVCodec *pCodec;
|
||||||
AVCodecContext *pCodecCtx;
|
AVCodecContext *pCodecCtx;
|
||||||
|
|
||||||
if (BLI_testextensie_n(
|
if (BLI_path_extension_check_n(
|
||||||
filename,
|
filename,
|
||||||
".swf", ".jpg", ".png", ".dds", ".tga", ".bmp", ".tif", ".exr", ".cin", ".wav", NULL))
|
".swf", ".jpg", ".png", ".dds", ".tga", ".bmp", ".tif", ".exr", ".cin", ".wav", NULL))
|
||||||
{
|
{
|
||||||
|
@ -726,7 +726,7 @@ void BPY_modules_load_user(bContext *C)
|
|||||||
bpy_context_set(C, &gilstate);
|
bpy_context_set(C, &gilstate);
|
||||||
|
|
||||||
for (text = bmain->text.first; text; text = text->id.next) {
|
for (text = bmain->text.first; text; text = text->id.next) {
|
||||||
if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) {
|
if (text->flags & TXT_ISSCRIPT && BLI_path_extension_check(text->id.name + 2, ".py")) {
|
||||||
if (!(G.f & G_SCRIPT_AUTOEXEC)) {
|
if (!(G.f & G_SCRIPT_AUTOEXEC)) {
|
||||||
if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
|
if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
|
||||||
G.f |= G_SCRIPT_AUTOEXEC_FAIL;
|
G.f |= G_SCRIPT_AUTOEXEC_FAIL;
|
||||||
|
@ -2157,7 +2157,7 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
|
|||||||
ImageFormatData imf = rd->im_format;
|
ImageFormatData imf = rd->im_format;
|
||||||
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
||||||
|
|
||||||
if (BLI_testextensie(name, ".exr"))
|
if (BLI_path_extension_check(name, ".exr"))
|
||||||
name[strlen(name) - 4] = 0;
|
name[strlen(name) - 4] = 0;
|
||||||
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
||||||
|
|
||||||
@ -2212,7 +2212,7 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
|
|||||||
ImageFormatData imf = rd->im_format;
|
ImageFormatData imf = rd->im_format;
|
||||||
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
imf.imtype = R_IMF_IMTYPE_JPEG90;
|
||||||
|
|
||||||
if (BLI_testextensie(name, ".exr"))
|
if (BLI_path_extension_check(name, ".exr"))
|
||||||
name[strlen(name) - 4] = 0;
|
name[strlen(name) - 4] = 0;
|
||||||
|
|
||||||
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
BKE_image_path_ensure_ext_from_imformat(name, &imf);
|
||||||
|
@ -1227,7 +1227,7 @@ static void render_result_exr_file_cache_path(Scene *sce, const char *root, char
|
|||||||
const char *blendfile_path = BKE_main_blendfile_path_from_global();
|
const char *blendfile_path = BKE_main_blendfile_path_from_global();
|
||||||
if (blendfile_path[0] != '\0') {
|
if (blendfile_path[0] != '\0') {
|
||||||
BLI_split_dirfile(blendfile_path, dirname, filename, sizeof(dirname), sizeof(filename));
|
BLI_split_dirfile(blendfile_path, dirname, filename, sizeof(dirname), sizeof(filename));
|
||||||
BLI_replace_extension(filename, sizeof(filename), ""); /* strip '.blend' */
|
BLI_path_extension_replace(filename, sizeof(filename), ""); /* strip '.blend' */
|
||||||
BLI_hash_md5_buffer(blendfile_path, strlen(blendfile_path), path_digest);
|
BLI_hash_md5_buffer(blendfile_path, strlen(blendfile_path), path_digest);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1100,7 +1100,7 @@ bool write_crash_blend(void)
|
|||||||
int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on crash file */
|
int fileflags = G.fileflags & ~(G_FILE_HISTORY); /* don't do file history on crash file */
|
||||||
|
|
||||||
BLI_strncpy(path, BKE_main_blendfile_path_from_global(), sizeof(path));
|
BLI_strncpy(path, BKE_main_blendfile_path_from_global(), sizeof(path));
|
||||||
BLI_replace_extension(path, sizeof(path), "_crash.blend");
|
BLI_path_extension_replace(path, sizeof(path), "_crash.blend");
|
||||||
if (BLO_write_file(G_MAIN, path, fileflags, NULL, NULL)) {
|
if (BLO_write_file(G_MAIN, path, fileflags, NULL, NULL)) {
|
||||||
printf("written: %s\n", path);
|
printf("written: %s\n", path);
|
||||||
return 1;
|
return 1;
|
||||||
@ -2166,9 +2166,9 @@ static bool blend_save_check(bContext *UNUSED(C), wmOperator *op)
|
|||||||
char filepath[FILE_MAX];
|
char filepath[FILE_MAX];
|
||||||
RNA_string_get(op->ptr, "filepath", filepath);
|
RNA_string_get(op->ptr, "filepath", filepath);
|
||||||
if (!BLO_has_bfile_extension(filepath)) {
|
if (!BLO_has_bfile_extension(filepath)) {
|
||||||
/* some users would prefer BLI_replace_extension(),
|
/* some users would prefer BLI_path_extension_replace(),
|
||||||
* we keep getting nitpicking bug reports about this - campbell */
|
* we keep getting nitpicking bug reports about this - campbell */
|
||||||
BLI_ensure_extension(filepath, FILE_MAX, ".blend");
|
BLI_path_extension_ensure(filepath, FILE_MAX, ".blend");
|
||||||
RNA_string_set(op->ptr, "filepath", filepath);
|
RNA_string_set(op->ptr, "filepath", filepath);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ static void sig_handle_crash(int signum)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BLI_strncpy(fname, G_MAIN->name, sizeof(fname));
|
BLI_strncpy(fname, G_MAIN->name, sizeof(fname));
|
||||||
BLI_replace_extension(fname, sizeof(fname), ".crash.blend");
|
BLI_path_extension_replace(fname, sizeof(fname), ".crash.blend");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Writing: %s\n", fname);
|
printf("Writing: %s\n", fname);
|
||||||
@ -144,7 +144,7 @@ static void sig_handle_crash(int signum)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BLI_join_dirfile(fname, sizeof(fname), BKE_tempdir_base(), BLI_path_basename(G_MAIN->name));
|
BLI_join_dirfile(fname, sizeof(fname), BKE_tempdir_base(), BLI_path_basename(G_MAIN->name));
|
||||||
BLI_replace_extension(fname, sizeof(fname), ".crash.txt");
|
BLI_path_extension_replace(fname, sizeof(fname), ".crash.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Writing: %s\n", fname);
|
printf("Writing: %s\n", fname);
|
||||||
|
Loading…
Reference in New Issue
Block a user