Gaffer - Custom Options Example
polygonMerge
plain_text
a year ago
14 kB
7
Indexable
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", 0, 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["Expression"] = Gaffer.Expression( "Expression" ) parent.addChild( __children["Expression"] ) __children["Expression"]["__in"].addChild( Gaffer.StringVectorDataPlug( "p0", defaultValue = IECore.StringVectorData( [ ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Expression"]["__out"].addChild( Gaffer.StringVectorDataPlug( "p0", direction = Gaffer.Plug.Direction.Out, defaultValue = IECore.StringVectorData( [ ] ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Expression"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"] = Gaffer.Spreadsheet( "Spreadsheet_shots_fin_locators_paths_SEQ2" ) parent.addChild( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"] ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"].addColumn( Gaffer.StringPlug( "fileName", defaultValue = '', ) ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"].addRows( 25 ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) ) __children["OptionsShots"]["options"]["member2"]["name"].setValue( 'trailer:shots' ) __children["OptionsShots"]["options"]["member2"]["value"].setInput( __children["Expression"]["__out"]["p0"] ) __children["OptionsShots"]["__uiPosition"].setValue( imath.V2f( 4.76837158e-07, 78.3551788 ) ) __children["Expression"]["__in"]["p0"].setInput( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["enabledRowNames"] ) __children["Expression"]["__uiPosition"].setValue( imath.V2f( -19.6563549, 78.128067 ) ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"], 'nodeGadget:type', 'GafferUI::StandardNodeGadget' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["selector"].setValue( '${shot}' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][1]["name"].setValue( 'CWD_201_020_010' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][1]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][2]["name"].setValue( 'CWD_201_020_020' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][2]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_020/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][3]["name"].setValue( 'CWD_201_020_030' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][3]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][4]["name"].setValue( 'CWD_201_020_040' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][4]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][5]["name"].setValue( 'CWD_201_026_010' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][5]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][6]["name"].setValue( 'CWD_201_030_020' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][6]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][7]["name"].setValue( 'CWD_201_030_030' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][7]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][8]["name"].setValue( 'CWD_201_030_040' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][8]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][9]["name"].setValue( 'CWD_201_030_050' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][9]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][10]["name"].setValue( 'CWD_201_030_060' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][10]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][11]["name"].setValue( 'CWD_201_030_070' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][11]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][12]["name"].setValue( 'CWD_201_030_080' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][12]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][13]["name"].setValue( 'CWD_201_030_090' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][13]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][14]["name"].setValue( 'CWD_201_030_100' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][14]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][15]["name"].setValue( 'CWD_201_060_010' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][15]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][16]["name"].setValue( 'CWD_201_060_020' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][16]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][17]["name"].setValue( 'CWD_201_060_030' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][17]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][18]["name"].setValue( 'CWD_201_060_040' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][18]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][19]["name"].setValue( 'CWD_201_060_050' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][19]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][20]["name"].setValue( 'CWD_201_060_060' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][20]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][21]["name"].setValue( 'CWD_201_070_010_B' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][21]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][22]["name"].setValue( 'CWD_201_070_020' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][22]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][23]["name"].setValue( 'CWD_201_070_040' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][23]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][24]["name"].setValue( 'CWD_201_070_060' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][24]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][25]["name"].setValue( 'CWD_201_070_070' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][25]["cells"]["fileName"]["value"].setValue( 'Y:/CWD2/episodes/Trailer/shots/CWD_201_020_010/products/fin_locators/v0002/Charlie_Prime_Biped_01_locators.abc' ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"], 'spreadsheet:columnWidth', 729 ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'ui:scene:acceptsSetName:promotable', False ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'ui:scene:acceptsSetNames:promotable', False ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'ui:scene:acceptsSetExpression:promotable', False ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'renameable:promotable', False ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'deletable:promotable', False ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'nodule:type', '' ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'description', "The name of the file to be loaded. The file can be\nin any of the formats supported by Cortex's SceneInterfaces." ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'plugValueWidget:type', 'GafferUI.FileSystemPathPlugValueWidget' ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'path:leaf', True ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'path:valid', True ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'path:bookmarks', 'sceneCache' ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'fileSystemPath:extensions', 'abc lscc scc usd usda usdc usdz vdb' ) Gaffer.Metadata.registerValue( __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["rows"][0]["cells"]["fileName"]["value"], 'fileSystemPath:extensionsLabel', 'Show only cache files' ) __children["Spreadsheet_shots_fin_locators_paths_SEQ2"]["__uiPosition"].setValue( imath.V2f( -19.466814, 91.6661682 ) ) __children["Expression"]["__engine"].setValue( 'python' ) __children["Expression"]["__expression"].setValue( 'shots = parent["__in"]["p0"]\nparent["__out"]["p0"] = shots' ) del __children
Editor is loading...
Leave a Comment