Shots - CustomOptions + expression

 avatar
polygonMerge
plain_text
22 days ago
2.4 kB
3
Indexable
Never
import Gaffer
import GafferScene
import IECore
import imath

Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 4, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 4, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 0, persistent=False )

__children = {}

__children["OptionsShots"] = GafferScene.CustomOptions( "OptionsShots" )
parent.addChild( __children["OptionsShots"] )
__children["OptionsShots"]["options"].addChild( Gaffer.NameValuePlug( "", Gaffer.StringVectorDataPlug( "value", defaultValue = IECore.StringVectorData( [  ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member2", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children["OptionsShots"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Expression8"] = Gaffer.Expression( "Expression8" )
parent.addChild( __children["Expression8"] )
__children["Expression8"]["__in"].addChild( Gaffer.AtomicCompoundDataPlug( "p0", defaultValue = IECore.CompoundData(), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Expression8"]["__out"].addChild( Gaffer.StringVectorDataPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = IECore.StringVectorData( [  ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Expression8"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["OptionsShots"]["options"]["member2"]["name"].setValue( 'shots:linked' )
__children["OptionsShots"]["options"]["member2"]["value"].setInput( __children["Expression8"]["__out"]["p0"] )
__children["OptionsShots"]["__uiPosition"].setValue( imath.V2f( -81.1041107, 92.4248428 ) )
__children["Expression8"]["__uiPosition"].setValue( imath.V2f( -60.2250252, 91.9236755 ) )
__children["Expression8"]["__engine"].setValue( 'python' )
__children["Expression8"]["__expression"].setValue( 'shot_dict = dict(parent["__in"]["p0"])\nparent["__out"]["p0"] = IECore.StringVectorData( list( shot_dict.keys() ) )' )


del __children

Leave a Comment