Skip to content

Commit

Permalink
Cryptomatte : Rename __manifestScene plug
Browse files Browse the repository at this point in the history
This becomes necessary now that we make the Hierarchy View ignore private plugs. `__manifestScene` will now be ignored, resulting in the Hierarchy View no longer displaying the Cryptomatte manifest, so we rename the plug to `manifestScene` and hide both its nodeGadget and plugValueWidget.
  • Loading branch information
murraystevenson committed Jun 27, 2024
1 parent 52a98f6 commit 8486923
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions python/GafferSceneTest/CryptomatteTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def testSceneValid( self ) :
c["in"].setInput( r["out"] )

c["layer"].setValue( "crypto_object" )
self.assertSceneValid( c["__manifestScene"] )
self.assertSceneValid( c["manifestScene"] )

def testChildNames( self ) :

Expand All @@ -450,10 +450,10 @@ def testChildNames( self ) :

cs = GafferTest.CapturingSlot( c.plugDirtiedSignal() )
c["layer"].setValue( "crypto_object" )
self.assertTrue( c["__manifestScene"]["childNames"] in [ x[0] for x in cs ] )
self.assertTrue( c["manifestScene"]["childNames"] in [ x[0] for x in cs ] )

self.assertEqual(
c["__manifestScene"].childNames( "/GAFFERBOT/C_torso_GRP" ),
c["manifestScene"].childNames( "/GAFFERBOT/C_torso_GRP" ),
IECore.InternedStringVectorData( [ "C_head_GRP", "C_key_GRP", "C_torso_CPT", "L_armUpper_GRP", "L_legUpper_GRP", "R_armUpper_GRP", "R_legUpper_GRP" ] )
)

Expand Down
14 changes: 13 additions & 1 deletion python/GafferSceneUI/CryptomatteUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,18 @@ def __layerPresetValues( plug ) :

],

"manifestScene" : [

"description",
"""
A scene containing locations representing the contents of the Cryptomatte manifest.
""",

"plugValueWidget:type", None,
"nodeGadget:type", None,

],

}

)
Expand Down Expand Up @@ -410,7 +422,7 @@ def __selectAffected( node, context ) :
if not isinstance( node, GafferScene.Cryptomatte ) :
return

scene = node["__manifestScene"]
scene = node["manifestScene"]

with context :
pathMatcher = IECore.PathMatcher()
Expand Down
2 changes: 1 addition & 1 deletion src/GafferScene/Cryptomatte.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ Cryptomatte::Cryptomatte( const std::string &name )
addChild( new FloatVectorDataPlug( "__matteValues", Gaffer::Plug::Out, new FloatVectorData() ) );
addChild( new AtomicCompoundDataPlug( "__manifest", Gaffer::Plug::Out, new CompoundData() ) );
addChild( new PathMatcherDataPlug( "__manifestPaths", Gaffer::Plug::Out, new PathMatcherData ) );
addChild( new ScenePlug( "__manifestScene", Gaffer::Plug::Out ) );
addChild( new ScenePlug( "manifestScene", Gaffer::Plug::Out ) );
addChild( new FloatVectorDataPlug( "__matteChannelData", Gaffer::Plug::Out, GafferImage::ImagePlug::blackTile() ) );

outPlug()->formatPlug()->setInput( inPlug()->formatPlug() );
Expand Down

0 comments on commit 8486923

Please sign in to comment.