Skip to content

Commit

Permalink
ShaderUI : Fix missing identical shaders
Browse files Browse the repository at this point in the history
Fixes #5472
  • Loading branch information
ericmehl committed Sep 25, 2023
1 parent 1e465b0 commit 87c5e2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
- 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)
========
Expand Down
4 changes: 2 additions & 2 deletions python/GafferSceneUI/ShaderUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -600,7 +600,7 @@ def __parameters( self ) :
def __shaders( self ) :

if len( self ) > 0 :
uniqueShaders = { n.shaders()[ self[0] ].hash() : n.shaders()[ self[0] ] for n in self.__shaderNetworks if self[0] in n.shaders() }
uniqueShaders = { n.hash().append( self[0] ) : n.shaders()[ self[0] ] for n in self.__shaderNetworks if self[0] in n.shaders() }
return list( uniqueShaders.values() )

return None
Expand Down

0 comments on commit 87c5e2b

Please sign in to comment.