From f194e0f5f2a65d5562b7e0916a195dc38c320fa2 Mon Sep 17 00:00:00 2001 From: Murray Stevenson <50844517+murraystevenson@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:57:46 -0700 Subject: [PATCH 1/5] StringPlugValueWidget : Fix `Esc` keypress We were calling a function from the legacy PlugValueWidget API, which is not available for classes using the new API. --- Changes.md | 1 + python/GafferUI/StringPlugValueWidget.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 8fa36fe5612..cf0d544966e 100644 --- a/Changes.md +++ b/Changes.md @@ -5,6 +5,7 @@ Fixes ----- - GraphEditor : Removed dynamic raster-space sizing of focus icon, as it caused excessive overlap with other nodes at certain zoom levels and on certain high resolution displays (#5435). +- StringPlugValueWidget : Fixed bug handling Esc. 1.2.10.3 (relative to 1.2.10.2) ======== diff --git a/python/GafferUI/StringPlugValueWidget.py b/python/GafferUI/StringPlugValueWidget.py index c0a37770f1c..867c3e4b241 100644 --- a/python/GafferUI/StringPlugValueWidget.py +++ b/python/GafferUI/StringPlugValueWidget.py @@ -142,7 +142,7 @@ def __keyPress( self, widget, event ) : # escape abandons everything if event.key == "Escape" : - self._updateFromPlugs() + self._requestUpdateFromValues() return True elif event.key == "Backspace" : # Allow a 'delete' press with the initial keyboard focus and a From d15f8bdd35ad02f2ae3b790a1d3510001022263e Mon Sep 17 00:00:00 2001 From: Daniel Dresser Date: Mon, 25 Sep 2023 21:27:09 -0700 Subject: [PATCH 2/5] IECoreArnold : Don't set deprecated "opaque" unless non-default This prevents Arnold outputting warning messages unless someone specifically sets opaque to False, instead of leaving it at the default True. --- Changes.md | 1 + src/IECoreArnold/Renderer.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index cf0d544966e..9da055dd3e7 100644 --- a/Changes.md +++ b/Changes.md @@ -6,6 +6,7 @@ Fixes - GraphEditor : Removed dynamic raster-space sizing of focus icon, as it caused excessive overlap with other nodes at certain zoom levels and on certain high resolution displays (#5435). - StringPlugValueWidget : Fixed bug handling Esc. +- Don't set deprecated "opaque" attribute in Arnold unless explicitly requested ( avoids deprecation warning from Arnold ) 1.2.10.3 (relative to 1.2.10.2) ======== diff --git a/src/IECoreArnold/Renderer.cpp b/src/IECoreArnold/Renderer.cpp index 4c869ae0e2d..9815c3d8822 100644 --- a/src/IECoreArnold/Renderer.cpp +++ b/src/IECoreArnold/Renderer.cpp @@ -1352,7 +1352,16 @@ class ArnoldAttributes : public IECoreScenePreview::Renderer::AttributesInterfac AiNodeSetStr( node, g_transformTypeArnoldString, m_transformType ); AiNodeSetBool( node, g_receiveShadowsArnoldString, m_shadingFlags & ArnoldAttributes::ReceiveShadows ); AiNodeSetBool( node, g_selfShadowsArnoldString, m_shadingFlags & ArnoldAttributes::SelfShadows ); - AiNodeSetBool( node, g_opaqueArnoldString, m_shadingFlags & ArnoldAttributes::Opaque ); + + if( !( m_shadingFlags & ArnoldAttributes::Opaque ) ) + { + AiNodeSetBool( node, g_opaqueArnoldString, false ); + } + else + { + AiNodeResetParameter( node, g_opaqueArnoldString ); + } + AiNodeSetBool( node, g_matteArnoldString, m_shadingFlags & ArnoldAttributes::Matte ); if( m_surfaceShader && m_surfaceShader->root() ) From 397a9e06e2c4d0a393439ae6231af929ec858c0b Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 15 Sep 2023 16:54:32 -0400 Subject: [PATCH 3/5] 3Delight : Add additional outputs --- Changes.md | 1 + contrib/scripts/3delightOutputs.py | 44 ++++++++++++++++++++ src/IECoreDelight/Renderer.cpp | 7 +++- startup/gui/outputs.py | 64 +++++++++++++++++++++++------- 4 files changed, 100 insertions(+), 16 deletions(-) create mode 100644 contrib/scripts/3delightOutputs.py diff --git a/Changes.md b/Changes.md index c493bb96b3a..c3a2dab6a44 100644 --- a/Changes.md +++ b/Changes.md @@ -8,6 +8,7 @@ Improvements - The Drawing Mode dropdown menu can be used to to choose the visible purposes. - The default purposes can be specified in a startup file using `Gaffer.Metadata.registerValue( GafferSceneUI.SceneView, "drawingMode.includedPurposes.value", "userDefault", IECore.StringVectorData( [ "default", "proxy" ] ) )`. - StandardOptions : Added `includedPurposes` plug, to control which locations are included in a render based on the value of their `usd:purpose` attribute. +- 3Delight : Added additional output presets. Fixes ----- diff --git a/contrib/scripts/3delightOutputs.py b/contrib/scripts/3delightOutputs.py new file mode 100644 index 00000000000..d93937756cb --- /dev/null +++ b/contrib/scripts/3delightOutputs.py @@ -0,0 +1,44 @@ +#! /usr/bin/env python + +# Prints out handy parsing of the 3Delight for Houdini outputs ready for +# 3Delight entries in `outputs.py`. + + +import urllib.request +import shlex + +url = "https://gitlab.com/3Delight/3delight-for-houdini/-/raw/master/ui/aov.cpp" + +outputsRaw = [] + +with urllib.request.urlopen( url ) as f : + lines = f.read().decode( "utf-8" ).split("\n") + for i in range( 0, len( lines ) ) : + line = lines[i] + if line.strip() == "std::vector descriptions =" : + i += 1 # Skip `{` + line = lines[i] + while line.strip() != "};" : + outputsRaw.append( line.strip()[1:-2].strip() ) # Remove leading `{` and trailing `},` + i += 1 + line = lines[i] + break + +outputs = [] +print("for name, displayName, source, dataType in [") +for o in outputsRaw : + if o == "" : + continue + m_type, m_ui_name, m_filename_token, m_variable_name, m_variable_source, m_layer_type, m_with_alpha, m_support_mutlilight = shlex.split( o ) + + m_layer_type = { "vector": "point", "scalar": "float" }.get( m_layer_type.rstrip( "," ), m_layer_type ) + + print( + ' ( "{}", "{}", "{}", "{}" ),'.format( + m_variable_name.rstrip( "," ), + m_ui_name.rstrip( "," ), + m_variable_source.rstrip( "," ), + m_layer_type.rstrip( "," ) + ) + ) +print( "] :\n\n" ) diff --git a/src/IECoreDelight/Renderer.cpp b/src/IECoreDelight/Renderer.cpp index b36a605c14a..783dd9b96bd 100644 --- a/src/IECoreDelight/Renderer.cpp +++ b/src/IECoreDelight/Renderer.cpp @@ -46,6 +46,7 @@ #include "IECoreScene/ShaderNetwork.h" #include "IECoreScene/ShaderNetworkAlgo.h" +#include "IECore/CamelCase.h" #include "IECore/MessageHandler.h" #include "IECore/SearchPath.h" #include "IECore/SimpleTypedData.h" @@ -319,7 +320,11 @@ class DelightOutput : public IECore::RefCounted variableName = nameTokens[1]; variableSource = nameTokens[0]; } - layerName = variableName; + + // Remove the `.` character and use camel case + vector layerTokens; + IECore::StringAlgo::tokenize( variableName, '.', layerTokens ); + layerName = IECore::CamelCase::join( layerTokens.begin(), layerTokens.end(), IECore::CamelCase::AllExceptFirst); } ParameterList layerParams; diff --git a/startup/gui/outputs.py b/startup/gui/outputs.py index 7d52e4763a8..2ab2bffc811 100644 --- a/startup/gui/outputs.py +++ b/startup/gui/outputs.py @@ -169,22 +169,56 @@ # and we won't add any unnecessary output definitions. import GafferDelight - for aov in [ - "diffuse", - "subsurface", - "reflection", - "refraction", - "incandescence", + # Should be kept up to date with + # https://gitlab.com/3Delight/3delight-for-houdini/-/blob/master/ui/aov.cpp + # See `contrib/scripts/3delightOutputs.py` in this repository for a helper script. + + for name, displayName, source, dataType in [ + ( "Ci", "Ci", "shader", "color" ), + ( "Ci.direct", "Ci (direct)", "shader", "color" ), + ( "Ci.indirect", "Ci (indirect)", "shader", "color" ), + ( "diffuse", "Diffuse", "shader", "color" ), + ( "diffuse.direct", "Diffuse (direct)", "shader", "color" ), + ( "diffuse.indirect", "Diffuse (indirect)", "shader", "color" ), + ( "hair", "Hair and Fur", "shader", "color" ), + ( "subsurface", "Subsurface Scattering", "shader", "color" ), + ( "reflection", "Reflection", "shader", "color" ), + ( "reflection.direct", "Reflection (direct)", "shader", "color" ), + ( "reflection.indirect", "Reflection (indirect)", "shader", "color" ), + ( "refraction", "Refraction", "shader", "color" ), + ( "volume", "Volume Scattering", "shader", "color" ), + ( "volume.direct", "Volume Scattering (direct)", "shader", "color" ), + ( "volume.indirect", "Volume Scattering (indirect)", "shader", "color" ), + ( "incandescence", "Incandescence", "shader", "color" ), + ( "toon_base", "Toon Base", "shader", "color" ), + ( "toon_diffuse", "Toon Diffuse", "shader", "color" ), + ( "toon_specular", "Toon Specular", "shader", "color" ), + ( "toon_matte", "Toon Matte", "shader", "color" ), + ( "toon_tint", "Toon Tint", "shader", "color" ), + ( "outlines", "Outlines", "shader", "quad" ), + ( "albedo", "Albedo", "shader", "color" ), + ( "z", "Z (depth)", "builtin", "float" ), + ( "P.camera", "Camera Space Position", "builtin", "point" ), + ( "N.camera", "Camera Space Normal", "builtin", "point" ), + ( "P.world", "World Space Position", "builtin", "point" ), + ( "N.world", "World Space Normal", "builtin", "point" ), + ( "Pref", "Reference Position", "attribute", "point" ), + ( "shadow_mask", "Shadow Mask", "shader", "color" ), + ( "st", "UV", "attribute", "point" ), + ( "id.geometry", "Geometry Cryptomatte", "builtin", "float" ), + ( "id.scenepath", "Scene Path Cryptomatte", "builtin", "float" ), + ( "id.surfaceshader", "Surface Shader Cryptomatte", "builtin", "float" ), + ( "relighting_multiplier", "Relighting Multiplier", "shader", "color" ), + ( "relighting_reference", "Relighting Reference", "shader", "color" ), + ( "motionvector", "Motion Vector", "builtin", "point" ), + ( "occlusion", "Ambient Occlusion", "shader", "color" ), ] : - - label = aov.title() - GafferScene.Outputs.registerOutput( - "Interactive/3Delight/" + label, + "Interactive/3Delight/{}/{}".format( source.capitalize(), displayName ), IECoreScene.Output( - aov, + name, "ieDisplay", - "color " + aov, + "{} {}:{}".format( dataType, source, name ), { "driverType" : "ClientDisplayDriver", "displayHost" : "localhost", @@ -195,11 +229,11 @@ ) GafferScene.Outputs.registerOutput( - "Batch/3Delight/" + label, + "Batch/3Delight/{}/{}".format( source.capitalize(), displayName ), IECoreScene.Output( - "${project:rootDirectory}/renders/${script:name}/%s/%s.####.exr" % ( aov, aov ), + "${project:rootDirectory}/renders/${script:name}/%s/%s.####.exr" % ( name, name ), "exr", - "color " + aov, + "{} {}:{}".format( dataType, source, name ), ) ) From dd9ef43ad8117a896e638c4532ae570c3e54ab83 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 27 Sep 2023 10:57:38 +0100 Subject: [PATCH 4/5] Changes.md : Conform formatting and mood, improve clarity --- Changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 9da055dd3e7..1425ac0f80f 100644 --- a/Changes.md +++ b/Changes.md @@ -6,7 +6,7 @@ Fixes - GraphEditor : Removed dynamic raster-space sizing of focus icon, as it caused excessive overlap with other nodes at certain zoom levels and on certain high resolution displays (#5435). - StringPlugValueWidget : Fixed bug handling Esc. -- Don't set deprecated "opaque" attribute in Arnold unless explicitly requested ( avoids deprecation warning from Arnold ) +- Arnold : Fixed unnecessary `opaque` attribute deprecation warnings. These are now only emitted in the case that `opaque` has been explicitly turned off. 1.2.10.3 (relative to 1.2.10.2) ======== From 0eba67dd99a4e50bb9a0d6eb091f6e87052ef3a4 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Mon, 25 Sep 2023 17:54:34 -0400 Subject: [PATCH 5/5] ShaderUI : Fix missing identical shaders Fixes #5472 --- Changes.md | 1 + python/GafferSceneUI/ShaderUI.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 1425ac0f80f..7d554656f43 100644 --- a/Changes.md +++ b/Changes.md @@ -7,6 +7,7 @@ Fixes - GraphEditor : Removed dynamic raster-space sizing of focus icon, as it caused excessive overlap with other nodes at certain zoom levels and on certain high resolution displays (#5435). - StringPlugValueWidget : Fixed bug handling Esc. - Arnold : Fixed unnecessary `opaque` attribute deprecation warnings. These are now only emitted in the case that `opaque` has been explicitly turned off. +- ShaderUI : Fixed bug causing identical but independent shaders in a shader network from being included in the shader browser. 1.2.10.3 (relative to 1.2.10.2) ======== diff --git a/python/GafferSceneUI/ShaderUI.py b/python/GafferSceneUI/ShaderUI.py index 38799b5bd33..ac22248b6f0 100644 --- a/python/GafferSceneUI/ShaderUI.py +++ b/python/GafferSceneUI/ShaderUI.py @@ -549,7 +549,7 @@ def _children( self, canceller ) : shaderNetwork, shaderHandle = stack.popleft() shader = shaderNetwork.shaders()[shaderHandle] - h = shaderNetwork.hash().append( shader.hash() ) + h = shaderNetwork.hash().append( shaderHandle ) if h not in visited : visited.add( h )