diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2019-12-16 05:58:01 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-12-16 06:09:53 +0300 |
commit | 31ac2e292e5fc5d4d85d00d97645bfcb9cd4e6c2 (patch) | |
tree | ea8e2f273b8eb7ddc5bb951dc9ffaa613422e246 /intern/cycles/render/nodes.cpp | |
parent | 5a97a74c69c082d9360fc21b8c6b99fd24912f5f (diff) |
Cycles: Fix one-tile UDIM rendering
The code checked for the presence of more than one tile before
substituting the tile number into the filename, so if a one-tile
UDIM was used (or all but one tile were culled), the substitution
was skipped and as a result the file was not found.
With this change, the code explicitly tracks whether substitution
is required, avoiding this problem.
This also fixes another problem: The Environment texture never
does substitution since it doesn't support UDIMs, but before the
syncing code still inserted the placeholder into the filename if the
user selected a tiled background image.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index b8847f92153..cd990393823 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -235,6 +235,8 @@ NODE_DEFINE(ImageTextureNode) SOCKET_STRING(filename, "Filename", ustring()); SOCKET_STRING(colorspace, "Colorspace", u_colorspace_auto); + SOCKET_BOOLEAN(is_tiled, "Is Tiled", false); + static NodeEnum alpha_type_enum; alpha_type_enum.insert("auto", IMAGE_ALPHA_AUTO); alpha_type_enum.insert("unassociated", IMAGE_ALPHA_UNASSOCIATED); @@ -366,15 +368,12 @@ void ImageTextureNode::compile(SVMCompiler &compiler) image_manager = compiler.scene->image_manager; if (slots.empty()) { cull_tiles(compiler.scene, compiler.current_graph); - } - if (slots.size() < tiles.size()) { - slots.clear(); slots.reserve(tiles.size()); bool have_metadata = false; foreach (int tile, tiles) { string tile_name = filename.string(); - if (tiles.size() > 1) { + if (is_tiled) { tile_name = string_printf(tile_name.c_str(), tile); } |