Fix failing Cycles tests after Cryptomatte changes

For old files without Cycles cryptomatte settings, must provide the defaults.
This commit is contained in:
Brecht Van Lommel 2020-12-07 13:11:17 +01:00
parent d329a6a937
commit cf9275dd4e
1 changed files with 5 additions and 5 deletions

View File

@ -198,11 +198,11 @@ def do_versions(self):
if scene.render.engine == 'CYCLES':
for view_layer in scene.view_layers:
cview_layer = view_layer.cycles
view_layer.use_pass_cryptomatte_object = cview_layer.get("use_pass_crypto_object")
view_layer.use_pass_cryptomatte_material = cview_layer.get("use_pass_crypto_material")
view_layer.use_pass_cryptomatte_asset = cview_layer.get("use_pass_crypto_asset")
view_layer.pass_cryptomatte_depth = cview_layer.get("pass_crypto_depth")
view_layer.use_pass_cryptomatte_accurate = cview_layer.get("pass_crypto_accurate")
view_layer.use_pass_cryptomatte_object = cview_layer.get("use_pass_crypto_object", False)
view_layer.use_pass_cryptomatte_material = cview_layer.get("use_pass_crypto_material", False)
view_layer.use_pass_cryptomatte_asset = cview_layer.get("use_pass_crypto_asset", False)
view_layer.pass_cryptomatte_depth = cview_layer.get("pass_crypto_depth", 6)
view_layer.use_pass_cryptomatte_accurate = cview_layer.get("pass_crypto_accurate", True)
# Lamps
for light in bpy.data.lights: