Cycles: Use Blender Cryptomatte Settings.
Blender has now the place to store the Cryptomatte settings. This patch migrates Cycles to use the new settings. Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D9746
This commit is contained in:
@@ -667,10 +667,10 @@ 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 = divide_up(min(16, get_int(crl, "pass_crypto_depth")), 2);
|
||||
int crypto_depth = divide_up(min(16, b_view_layer.pass_cryptomatte_depth()), 2);
|
||||
scene->film->set_cryptomatte_depth(crypto_depth);
|
||||
CryptomatteType cryptomatte_passes = CRYPT_NONE;
|
||||
if (get_boolean(crl, "use_pass_crypto_object")) {
|
||||
if (b_view_layer.use_pass_cryptomatte_object()) {
|
||||
for (int i = 0; i < crypto_depth; i++) {
|
||||
string passname = cryptomatte_prefix + string_printf("Object%02d", i);
|
||||
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
|
||||
@@ -678,7 +678,7 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
|
||||
}
|
||||
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_OBJECT);
|
||||
}
|
||||
if (get_boolean(crl, "use_pass_crypto_material")) {
|
||||
if (b_view_layer.use_pass_cryptomatte_material()) {
|
||||
for (int i = 0; i < crypto_depth; i++) {
|
||||
string passname = cryptomatte_prefix + string_printf("Material%02d", i);
|
||||
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
|
||||
@@ -686,7 +686,7 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
|
||||
}
|
||||
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_MATERIAL);
|
||||
}
|
||||
if (get_boolean(crl, "use_pass_crypto_asset")) {
|
||||
if (b_view_layer.use_pass_cryptomatte_asset()) {
|
||||
for (int i = 0; i < crypto_depth; i++) {
|
||||
string passname = cryptomatte_prefix + string_printf("Asset%02d", i);
|
||||
b_engine.add_pass(passname.c_str(), 4, "RGBA", b_view_layer.name().c_str());
|
||||
@@ -694,7 +694,7 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
|
||||
}
|
||||
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_ASSET);
|
||||
}
|
||||
if (get_boolean(crl, "pass_crypto_accurate") && cryptomatte_passes != CRYPT_NONE) {
|
||||
if (b_view_layer.use_pass_cryptomatte_accurate() && cryptomatte_passes != CRYPT_NONE) {
|
||||
cryptomatte_passes = (CryptomatteType)(cryptomatte_passes | CRYPT_ACCURATE);
|
||||
}
|
||||
scene->film->set_cryptomatte_passes(cryptomatte_passes);
|
||||
|
||||
Reference in New Issue
Block a user