Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetFilter : Fix set menu when UnionFilter is downstream #2678

Closed
johnhaddon opened this issue Jul 17, 2018 · 0 comments
Closed

SetFilter : Fix set menu when UnionFilter is downstream #2678

johnhaddon opened this issue Jul 17, 2018 · 0 comments
Labels
bug Issues representing bugs scene Issues with GafferScene ui Issues related to the UI/UX in Gaffer

Comments

@johnhaddon
Copy link
Member

In the example below, the set menu only shows the sets from the Plane node, because the intermediate UnionFilter node is preventing the UI from realising the filter is also used by ShaderAssignment1.

It looks like there is some decent logic for dealing with this already in FilteredSceneProcessorUI.__selectAffected, so we should perhaps wrap that up so we can reuse it. Perhaps a SceneAlgo::affectedScenes( const FilterPlug * ) method to return all the scenes affected by a filter?

At the same time, we should probably give the __cameras and __lights sets nicer labels in the menu...

import Gaffer
import GafferScene
import IECore
import imath

Gaffer.Metadata.registerNodeValue( parent, "serialiser:milestoneVersion", 0, persistent=False )
Gaffer.Metadata.registerNodeValue( parent, "serialiser:majorVersion", 47, persistent=False )
Gaffer.Metadata.registerNodeValue( parent, "serialiser:minorVersion", 0, persistent=False )
Gaffer.Metadata.registerNodeValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children = {}

__children["Plane"] = GafferScene.Plane( "Plane" )
parent.addChild( __children["Plane"] )
__children["Plane"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Camera"] = GafferScene.Camera( "Camera" )
parent.addChild( __children["Camera"] )
__children["Camera"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ShaderAssignment"] = GafferScene.ShaderAssignment( "ShaderAssignment" )
parent.addChild( __children["ShaderAssignment"] )
__children["ShaderAssignment"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ShaderAssignment1"] = GafferScene.ShaderAssignment( "ShaderAssignment1" )
parent.addChild( __children["ShaderAssignment1"] )
__children["ShaderAssignment1"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["SetFilter"] = GafferScene.SetFilter( "SetFilter" )
parent.addChild( __children["SetFilter"] )
__children["SetFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["UnionFilter"] = GafferScene.UnionFilter( "UnionFilter" )
parent.addChild( __children["UnionFilter"] )
__children["UnionFilter"]["in"].addChild( GafferScene.FilterPlug( "in1", defaultValue = 0, minValue = 0, maxValue = 7, flags = ( Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) & ~Gaffer.Plug.Flags.Cacheable, ) )
__children["UnionFilter"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Plane"]["sets"].setValue( 'A B' )
__children["Plane"]["__uiPosition"].setValue( imath.V2f( -23.2999992, 9.55000019 ) )
__children["Camera"]["sets"].setValue( 'C' )
__children["Camera"]["__uiPosition"].setValue( imath.V2f( 11.6000023, 11.1499996 ) )
__children["ShaderAssignment"]["in"].setInput( __children["Plane"]["out"] )
__children["ShaderAssignment"]["filter"].setInput( __children["SetFilter"]["out"] )
__children["ShaderAssignment"]["__uiPosition"].setValue( imath.V2f( -23.2999992, -11.5140619 ) )
__children["ShaderAssignment1"]["in"].setInput( __children["Camera"]["out"] )
__children["ShaderAssignment1"]["filter"].setInput( __children["UnionFilter"]["out"] )
__children["ShaderAssignment1"]["__uiPosition"].setValue( imath.V2f( 9.79999733, -12.2500019 ) )
__children["SetFilter"]["__uiPosition"].setValue( imath.V2f( -4.59999943, 8.34999847 ) )
__children["UnionFilter"]["in"]["in0"].setInput( __children["SetFilter"]["out"] )
__children["UnionFilter"]["__uiPosition"].setValue( imath.V2f( 19.2999992, -5.44999886 ) )


del __children
@johnhaddon johnhaddon added bug Issues representing bugs component-ui scene Issues with GafferScene labels Jul 17, 2018
@andrewkaufman andrewkaufman added ui Issues related to the UI/UX in Gaffer and removed ui labels Jun 18, 2019
johnhaddon added a commit to johnhaddon/gaffer that referenced this issue May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues representing bugs scene Issues with GafferScene ui Issues related to the UI/UX in Gaffer
Projects
None yet
Development

No branches or pull requests

2 participants