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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-03-21 03:37:00 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2020-03-21 17:04:12 +0300
commit3033b2a0442fad0af9a2f57054397fec4efba97b (patch)
treed3394ddf0bbb86d605983e746ef05ee9e2241286 /intern/cycles/blender/blender_sync.cpp
parentada28d3c658492c10091c5dddd3278503f43db4c (diff)
Fix T73372: cryptomatte not filling last pass for odd number of levels
Make logic consistent with the render pass creation in Python.
Diffstat (limited to 'intern/cycles/blender/blender_sync.cpp')
-rw-r--r--intern/cycles/blender/blender_sync.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 91d715af7e2..28a737c3341 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -633,12 +633,12 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
/* Cryptomatte stores two ID/weight pairs per RGBA layer.
* User facing parameter is the number of pairs. */
- int crypto_depth = min(16, get_int(crp, "pass_crypto_depth")) / 2;
+ int crypto_depth = min(16, get_int(crp, "pass_crypto_depth"));
scene->film->cryptomatte_depth = crypto_depth;
scene->film->cryptomatte_passes = CRYPT_NONE;
if (get_boolean(crp, "use_pass_crypto_object")) {
- for (int i = 0; i < crypto_depth; ++i) {
- string passname = cryptomatte_prefix + string_printf("Object%02d", i);
+ for (int i = 0; i < crypto_depth; i += 2) {
+ string passname = cryptomatte_prefix + string_printf("Object%02d", i / 2);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
Pass::add(PASS_CRYPTOMATTE, passes, passname.c_str());
}
@@ -646,8 +646,8 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
CRYPT_OBJECT);
}
if (get_boolean(crp, "use_pass_crypto_material")) {
- for (int i = 0; i < crypto_depth; ++i) {
- string passname = cryptomatte_prefix + string_printf("Material%02d", i);
+ for (int i = 0; i < crypto_depth; i += 2) {
+ string passname = cryptomatte_prefix + string_printf("Material%02d", i / 2);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
Pass::add(PASS_CRYPTOMATTE, passes, passname.c_str());
}
@@ -655,8 +655,8 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
CRYPT_MATERIAL);
}
if (get_boolean(crp, "use_pass_crypto_asset")) {
- for (int i = 0; i < crypto_depth; ++i) {
- string passname = cryptomatte_prefix + string_printf("Asset%02d", i);
+ for (int i = 0; i < crypto_depth; i += 2) {
+ string passname = cryptomatte_prefix + string_printf("Asset%02d", i / 2);
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
Pass::add(PASS_CRYPTOMATTE, passes, passname.c_str());
}