diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2019-12-18 03:47:48 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-12-18 03:51:47 +0300 |
commit | bdbcb0df1060e3c8a331f929848dee70ca0d5f38 (patch) | |
tree | 24e28ed0e17e717243c2b1dc2fa615d833de6a13 /source/blender/blenlib | |
parent | 87dba476fb2b6f03b24ce9d65ae0f88db6f3d156 (diff) |
Image Editor: Load UDIMs even if secondary tile is selected
Previously the user had to select the 1001 tile for this to work,
now any tile will work as long as the 1001 tile still exists on disk.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_path_util.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 75d5cb286ac..d2f651609f1 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -81,6 +81,12 @@ bool BLI_ensure_filename(char *filepath, size_t maxlen, const char *filename) AT 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_path(char *string, + const char *dir, + const char *head, + const char *tail, + unsigned short numlen, + int pic); /* removes trailing slash */ void BLI_cleanup_file(const char *relabase, char *path) ATTR_NONNULL(2); diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index dff1f77c1ab..cd1a0e2c328 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -157,6 +157,20 @@ void BLI_stringenc( sprintf(string, "%s%.*d%s", head, numlen, MAX2(0, pic), tail); } +/** + * Returns in area pointed to by string a string of the form "<dir><head><pic><tail>", where pic + * is formatted as numlen digits with leading zeroes. + */ +void BLI_stringenc_path(char *string, + const char *dir, + const char *head, + const char *tail, + unsigned short numlen, + int pic) +{ + sprintf(string, "%s%s%.*d%s", dir, head, numlen, MAX2(0, pic), tail); +} + static int BLI_path_unc_prefix_len(const char *path); /* defined below in same file */ /* ******************** string encoding ***************** */ |