Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
-----

- Cycles : Fixed rendering of shaders written with `IECOREUSD_WRITE_CONFORMANT_OSL_SHADERS=1`.
- BoxIO : Fixed `noduleLayout:section` metadata when BoxIn/BoxOut are set up from a plug of the opposite direction. This could result in EditScope nodes created immediately downstream of a Box having their `in` plug at the bottom of the node rather than the top.

1.6.21.5 (relative to 1.6.21.4)
========
Expand Down
14 changes: 14 additions & 0 deletions python/GafferTest/BoxInTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,20 @@ def testNoduleSectionMetadata( self ) :
self.assertEqual( Gaffer.Metadata.value( s["b"]["i"].promotedPlug(), "noduleLayout:section" ), "left" )
self.assertEqual( Gaffer.Metadata.value( s["b"]["i"].plug(), "noduleLayout:section" ), "right" )

def testNoduleSectionMetadataFromOutPlug( self ) :

s = Gaffer.ScriptNode()
s["n"] = GafferTest.AddNode()

Gaffer.Metadata.registerValue( s["n"]["sum"], "noduleLayout:section", "bottom" )

s["b"] = Gaffer.Box()
s["b"]["i"] = Gaffer.BoxIn()
s["b"]["i"].setup( s["n"]["sum"] )

self.assertEqual( Gaffer.Metadata.value( s["b"]["i"].promotedPlug(), "noduleLayout:section" ), "top" )
self.assertIsNone( Gaffer.Metadata.value( s["b"]["i"].plug(), "noduleLayout:section" ) )

def testPromotedPlugRemovalDeletesBoxIn( self ) :

s = Gaffer.ScriptNode()
Expand Down
14 changes: 14 additions & 0 deletions python/GafferTest/BoxOutTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@ def testNoduleSectionMetadata( self ) :
self.assertEqual( Gaffer.Metadata.value( s["b"]["o"].promotedPlug(), "noduleLayout:section" ), "right" )
self.assertEqual( Gaffer.Metadata.value( s["b"]["o"].plug(), "noduleLayout:section" ), "left" )

def testNoduleSectionMetadataFromInPlug( self ) :

s = Gaffer.ScriptNode()
s["n"] = GafferTest.AddNode()

Gaffer.Metadata.registerValue( s["n"]["op1"], "noduleLayout:section", "top" )

s["b"] = Gaffer.Box()
s["b"]["o"] = Gaffer.BoxOut()
s["b"]["o"].setup( s["n"]["op1"] )

self.assertEqual( Gaffer.Metadata.value( s["b"]["o"].promotedPlug(), "noduleLayout:section" ), "bottom" )
self.assertIsNone( Gaffer.Metadata.value( s["b"]["o"].plug(), "noduleLayout:section" ) )

def testPromotedPlugRemovalDeletesBoxOut( self ) :

s = Gaffer.ScriptNode()
Expand Down
28 changes: 28 additions & 0 deletions python/GafferTest/EditScopeTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,5 +189,33 @@ def testSerialisation( self ) :
self.assertEqual( p2["variables"][0]["value"].getValue(), p["variables"][0]["value"].getValue() )
self.assertEqual( s2["e"]["out"].getValue(), s["e"]["out"].getValue() )

def testSetupFromOutPlugWithSectionMetadata( self ) :

s = Gaffer.ScriptNode()
s["b"] = Gaffer.Box()
s["b"]["n"] = GafferTest.AddNode()
Gaffer.BoxIO.promote( s["b"]["n"]["sum"] )
Gaffer.Metadata.registerValue( s["b"]["sum"], "noduleLayout:section", "bottom" )

s["e"] = Gaffer.EditScope()
s["e"].setup( s["b"]["sum"] )

self.assertEqual( Gaffer.Metadata.value( s["e"]["in"], "noduleLayout:section" ), "top" )
self.assertEqual( Gaffer.Metadata.value( s["e"]["out"], "noduleLayout:section" ), "bottom" )

def testSetupFromInPlugWithSectionMetadata( self ) :

s = Gaffer.ScriptNode()
s["b"] = Gaffer.Box()
s["b"]["n"] = GafferTest.AddNode()
Gaffer.BoxIO.promote( s["b"]["n"]["op1"] )
Gaffer.Metadata.registerValue( s["b"]["op1"], "noduleLayout:section", "top" )

s["e"] = Gaffer.EditScope()
s["e"].setup( s["b"]["op1"] )

self.assertEqual( Gaffer.Metadata.value( s["e"]["in"], "noduleLayout:section" ), "top" )
self.assertEqual( Gaffer.Metadata.value( s["e"]["out"], "noduleLayout:section" ), "bottom" )

if __name__ == "__main__":
unittest.main()
2 changes: 1 addition & 1 deletion src/Gaffer/BoxIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void BoxIO::setup( const Plug *plug )
);

setupNoduleSectionMetadata(
m_direction == Plug::In ? outPlugInternal() : inPlugInternal(),
plug->direction() == Plug::In ? outPlugInternal() : inPlugInternal(),
plug
);

Expand Down