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:
authorLukas Stockner <lukas.stockner@freenet.de>2019-12-26 20:55:36 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2019-12-26 22:14:31 +0300
commite4413dc72bfb228b0cd8bd78891833bbd089bf8e (patch)
tree75d5cd8dc9fff5409f502d5a384d197d8bb08c6d /intern/cycles/blender/blender_util.h
parentf172441e30e78be004af31217724281aa33eaac6 (diff)
Cycles: Use OIIO UDIM tag instead of %04d
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 2c3e279a8d8..bea30a20b8c 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -234,24 +234,18 @@ static inline int render_resolution_y(BL::RenderSettings &b_render)
static inline string image_user_file_path(BL::ImageUser &iuser,
BL::Image &ima,
int cfra,
- bool *is_tiled)
+ bool load_tiled)
{
- if (is_tiled != NULL) {
- *is_tiled = false;
- }
-
char filepath[1024];
iuser.tile(0);
BKE_image_user_frame_calc(NULL, iuser.ptr.data, cfra);
BKE_image_user_file_path(iuser.ptr.data, ima.ptr.data, filepath);
- if (ima.source() == BL::Image::source_TILED && is_tiled != NULL) {
- char *udim_id = strstr(filepath, "1001");
- if (udim_id != NULL) {
- memcpy(udim_id, "%04d", 4);
- *is_tiled = true;
- }
+
+ string filepath_str = string(filepath);
+ if (load_tiled && ima.source() == BL::Image::source_TILED) {
+ string_replace(filepath_str, "1001", "<UDIM>");
}
- return string(filepath);
+ return filepath_str;
}
static inline int image_user_frame_number(BL::ImageUser &iuser, int cfra)