From e614d376e68101bdcf029ccd83d1769acd8f0a48 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:25:33 -0700 Subject: [PATCH 1/3] Outputs config : Add `deep_beauty` and `deep_alpha` presets for Arnold --- Changes.md | 1 + startup/gui/outputs.py | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Changes.md b/Changes.md index 8bd57cfd402..46a489c11f4 100644 --- a/Changes.md +++ b/Changes.md @@ -13,6 +13,7 @@ Improvements - Added the ability to edit the scale of node icons. - Improved layout of Box node plug creator visibility toggles. - ArnoldShader : Moved the `toon` shader's `*_tonemap_hue_saturation` parameters to appropriate sections in the UI. +- Arnold : Added `deep_alpha` and `deep_beauty` output presets demonstrating outputs that produce deep images. API --- diff --git a/startup/gui/outputs.py b/startup/gui/outputs.py index 9f10e6ee823..31999129871 100644 --- a/startup/gui/outputs.py +++ b/startup/gui/outputs.py @@ -118,12 +118,14 @@ "motionvector", "normal", "depth", + "deep_alpha", + "deep_beauty", ] : label = aov.replace( "_", " " ).title().replace( " ", "_" ) - if aov == "beauty": + if aov in ( "beauty", "deep_beauty" ) : data = "rgba" - elif aov == "depth": + elif aov in ( "depth", "deep_alpha" ) : data = "float Z" elif aov == "normal": data = "color N" @@ -140,9 +142,18 @@ if aov == "depth": parameters["layerName"] = "Z" - if aov not in { "motionvector", "emission", "background" } : + if aov not in { "motionvector", "emission", "background", "deep_alpha" } : parameters["layerPerLightGroup"] = False + if aov.startswith( "deep_" ) : + driver = "deepexr" + parameters["alpha_tolerance"] = 0.01 + parameters["depth_tolerance"] = 0.01 + parameters["alpha_half_precision"] = False + parameters["depth_half_precision"] = False + else : + driver = "exr" + interactiveParameters = parameters.copy() interactiveParameters.update( { @@ -167,7 +178,7 @@ "Batch/Arnold/" + label, IECoreScene.Output( "${project:rootDirectory}/renders/${script:name}/${renderPass}/%s/%s.####.exr" % ( aov, aov ), - "exr", + driver, data, parameters, ) From ed83b063b22749ab4c8377230278f5dbbed9ed64 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:27:34 -0700 Subject: [PATCH 2/3] Outputs config : Add `lpe` preset for Arnold --- Changes.md | 4 +++- startup/gui/outputs.py | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changes.md b/Changes.md index 46a489c11f4..66c805ffc14 100644 --- a/Changes.md +++ b/Changes.md @@ -13,7 +13,9 @@ Improvements - Added the ability to edit the scale of node icons. - Improved layout of Box node plug creator visibility toggles. - ArnoldShader : Moved the `toon` shader's `*_tonemap_hue_saturation` parameters to appropriate sections in the UI. -- Arnold : Added `deep_alpha` and `deep_beauty` output presets demonstrating outputs that produce deep images. +- Arnold : + - Added `deep_alpha` and `deep_beauty` output presets demonstrating outputs that produce deep images. + - Added `lpe` output preset demonstrating an output using a light path expression. API --- diff --git a/startup/gui/outputs.py b/startup/gui/outputs.py index 31999129871..7701cb70fc0 100644 --- a/startup/gui/outputs.py +++ b/startup/gui/outputs.py @@ -120,6 +120,7 @@ "depth", "deep_alpha", "deep_beauty", + "lpe", ] : label = aov.replace( "_", " " ).title().replace( " ", "_" ) @@ -129,6 +130,8 @@ data = "float Z" elif aov == "normal": data = "color N" + elif aov == "lpe" : + data = "lpe C.*" else: data = "color " + aov @@ -142,7 +145,7 @@ if aov == "depth": parameters["layerName"] = "Z" - if aov not in { "motionvector", "emission", "background", "deep_alpha" } : + if aov not in { "motionvector", "emission", "background", "deep_alpha", "lpe" } : parameters["layerPerLightGroup"] = False if aov.startswith( "deep_" ) : @@ -164,6 +167,9 @@ } ) + if aov == "lpe" : + interactiveParameters["layerName"] = "lpe" + GafferScene.Outputs.registerOutput( "Interactive/Arnold/" + label, IECoreScene.Output( From 7e6ba230e10d945d3b0408ec62457ac44b0651e0 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Thu, 22 Aug 2024 15:30:29 -0700 Subject: [PATCH 3/3] Outputs config : Whitespace fixes --- startup/gui/outputs.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/startup/gui/outputs.py b/startup/gui/outputs.py index 7701cb70fc0..a12a043a60e 100644 --- a/startup/gui/outputs.py +++ b/startup/gui/outputs.py @@ -128,11 +128,11 @@ data = "rgba" elif aov in ( "depth", "deep_alpha" ) : data = "float Z" - elif aov == "normal": + elif aov == "normal" : data = "color N" elif aov == "lpe" : data = "lpe C.*" - else: + else : data = "color " + aov if aov == "motionvector" : @@ -142,7 +142,7 @@ else : parameters = {} - if aov == "depth": + if aov == "depth" : parameters["layerName"] = "Z" if aov not in { "motionvector", "emission", "background", "deep_alpha", "lpe" } : @@ -365,7 +365,7 @@ def __registerOutputs( aovs, halfFloat = False, denoise = False ) : "halfFloat" : halfFloat } - if data == "lightgroup": + if data == "lightgroup" : data = "lg lightgroup" label = "Light_Group" @@ -389,7 +389,7 @@ def __registerOutputs( aovs, halfFloat = False, denoise = False ) : ) GafferScene.Outputs.registerOutput( - "Batch/Cycles/" + label, + "Batch/Cycles/" + label, IECoreScene.Output( "${project:rootDirectory}/renders/${script:name}/${renderPass}/%s/%s.####.exr" % ( aov, aov ), "exr", @@ -398,7 +398,7 @@ def __registerOutputs( aovs, halfFloat = False, denoise = False ) : ) ) - if denoise: + if denoise : interactiveOutput["denoise"] = True batchOutput["denoise"] = True