-
Notifications
You must be signed in to change notification settings - Fork 214
Description
Version: Gaffer 1.5.16.1-linux
Description
When exporting a box with a spreadsheet plug that has tweak plugs, the tweak plugs' mode is not exported with the box. Either we would expect to be able to set a default value on the tweak plug's mode plug and have that seriliased or a setValue should be serialised so we get the same value for the mode when we load the box again.
Steps to reproduce
You can load the following script on a box for testing.
import Gaffer
import GafferScene
import IECore
import imath
Gaffer.Metadata.registerValue( parent, "serialiser:milestoneVersion", 1, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:majorVersion", 5, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:minorVersion", 16, persistent=False )
Gaffer.Metadata.registerValue( parent, "serialiser:patchVersion", 1, persistent=False )
__children = {}
__children["Spreadsheet_plugTest"] = Gaffer.Spreadsheet( "Spreadsheet_plugTest" )
parent.addChild( __children["Spreadsheet_plugTest"] )
__children["Spreadsheet_plugTest"]["rows"].addColumn( Gaffer.TweakPlug( Gaffer.FloatPlug( "value", defaultValue = 0.0, ), "tweakPlug_test", ), adoptEnabledPlug = True )
__children["Spreadsheet_plugTest"]["rows"].addColumn( Gaffer.NameValuePlug( "", Gaffer.BoolPlug( "value", defaultValue = False, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "NameValuePlug_test", Gaffer.Plug.Flags.Default ), adoptEnabledPlug = True )
__children["Spreadsheet_plugTest"]["rows"].addColumn( Gaffer.IntPlug( "index", defaultValue = 0, minValue = 0, ) )
__children["Spreadsheet_plugTest"]["rows"].addColumn( Gaffer.TweakPlug( Gaffer.IntPlug( "value", defaultValue = 0, ), "tweakPlug_ContextVar_test", ), adoptEnabledPlug = True )
__children["Spreadsheet_plugTest"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ShaderTweaks"] = GafferScene.ShaderTweaks( "ShaderTweaks" )
parent.addChild( __children["ShaderTweaks"] )
__children["ShaderTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.FloatPlug( "value", defaultValue = 0.0, ), "tweak", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ShaderTweaks"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["CustomOptions"] = GafferScene.CustomOptions( "CustomOptions" )
parent.addChild( __children["CustomOptions"] )
__children["CustomOptions"]["options"].addChild( Gaffer.NameValuePlug( "", Gaffer.BoolPlug( "value", defaultValue = False, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "member1", Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic ) )
__children["CustomOptions"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["Switch"] = Gaffer.Switch( "Switch" )
parent.addChild( __children["Switch"] )
__children["Switch"].setup( GafferScene.ScenePlug( "in", ) )
__children["Switch"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ContextVariableTweaks"] = Gaffer.ContextVariableTweaks( "ContextVariableTweaks" )
parent.addChild( __children["ContextVariableTweaks"] )
__children["ContextVariableTweaks"].setup( GafferScene.ScenePlug( "in", ) )
__children["ContextVariableTweaks"]["tweaks"].addChild( Gaffer.TweakPlug( Gaffer.IntPlug( "value", defaultValue = 0, ), "tweak0", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["ContextVariableTweaks"].addChild( Gaffer.V2fPlug( "__uiPosition", defaultValue = imath.V2f( 0, 0 ), flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ) )
__children["rows"] = Gaffer.Spreadsheet.RowsPlug( "rows", flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, )
parent.addChild( __children["rows"] )
__children["rows"].addColumn( Gaffer.TweakPlug( Gaffer.FloatPlug( "value", defaultValue = 3.0, ), "tweakPlug_test", ), adoptEnabledPlug = True )
__children["rows"].addColumn( Gaffer.NameValuePlug( "", Gaffer.BoolPlug( "value", defaultValue = True, flags = Gaffer.Plug.Flags.Default | Gaffer.Plug.Flags.Dynamic, ), True, "NameValuePlug_test", Gaffer.Plug.Flags.Default ), adoptEnabledPlug = True )
__children["rows"].addColumn( Gaffer.IntPlug( "index", defaultValue = 0, minValue = 0, ) )
__children["rows"].addColumn( Gaffer.TweakPlug( Gaffer.IntPlug( "value", defaultValue = 0, ), "tweakPlug_ContextVar_test", ), adoptEnabledPlug = True )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"], 'nodeGadget:type', 'GafferUI::StandardNodeGadget' )
__children["Spreadsheet_plugTest"]["rows"].setInput( __children["rows"] )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"], 'spreadsheet:columnWidth', 169 )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'tweakPlugValueWidget:propertyType:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'nodule:type', 'GafferUI::CompoundNodule' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'noduleLayout:label', 'tweakPlug_test' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'spreadsheet:plugMenu:includeAsAncestor', True )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'spreadsheet:plugMenu:ancestorLabel', 'Tweak' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'noduleLayout:visible', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'tweakPlugValueWidget:propertyType', 'parameter' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"], 'plugValueWidget:type', 'GafferSceneUI.ShaderTweaksUI._ShaderTweakPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'description', 'The name of the parameter to apply the tweak to.' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["enabled"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'plugValueWidget:type', 'GafferUI.PresetsPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'presetNames', IECore.StringVectorData( [ 'Create', 'Create If Missing', 'Replace', 'Remove', 'Add', 'Subtract', 'Multiply', 'Min', 'Max' ] ) )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'presetValues', IECore.IntVectorData( [ 5, 11, 0, 4, 1, 2, 3, 6, 7 ] ) )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'description', "| Mode | Description |\n| :--- | :---------- |\n| Create | Sets the value of a parameter, creating it if it doesn't exist yet. |\n| Create If Missing | Like `Create`, but does nothing if the parameter already exists. |\n| Replace | Replaces an existing parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. When replacing a string parameter, the new value may contain a `{source}` token, which will be substituted with the original value. |\n| Remove | Removes an existing parameter. Does not error if the property doesn't exist. |\n| Add | Adds to an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Subtract | Subtracts from an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Multiply | Multiplies an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Min | Sets an existing numeric parameter to the minimum of its current value and the tweak value. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Max | Sets an existing numeric parameter to the maximum of its current value and the tweak value. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n" )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'nodule:color', imath.Color3f( 0.246700004, 0.376199991, 0.469999999 ) )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'nodule:type', 'GafferUI::StandardNodule' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'noduleLayout:label', 'tweakPlug_test' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"], 'spreadsheet:columnWidth', 224 )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'spreadsheet:plugMenu:includeAsAncestor', True )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'spreadsheet:plugMenu:ancestorLabel', 'Value and Switch' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'nameValuePlugPlugValueWidget:ignoreNamePlug', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'description', None )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'label', None )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["name"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["value"], 'plugValueWidget:type', None )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["NameValuePlug_test"]["value"]["enabled"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"], 'spreadsheet:columnWidth', 130 )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"], 'spreadsheet:columnLabel', 'boolPlug_test' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'description', 'The index of the input which is passed through. A value\nof 0 chooses the first input, 1 the second and so on. Values\nlarger than the number of available inputs wrap back around to\nthe beginning.' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["index"]["value"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["Spreadsheet_plugTest"]["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'spreadsheet:columnWidth', 204 )
__children["Spreadsheet_plugTest"]["__uiPosition"].setValue( imath.V2f( -6.51699114, 0.950000405 ) )
__children["ShaderTweaks"]["tweaks"]["tweak"].setInput( __children["Spreadsheet_plugTest"]["out"]["tweakPlug_test"] )
__children["ShaderTweaks"]["__uiPosition"].setValue( imath.V2f( 12.0830078, 0.950000405 ) )
__children["CustomOptions"]["options"]["member1"].setInput( __children["Spreadsheet_plugTest"]["out"]["NameValuePlug_test"] )
__children["CustomOptions"]["__uiPosition"].setValue( imath.V2f( 12.1171398, 6.75 ) )
__children["Switch"]["index"].setInput( __children["Spreadsheet_plugTest"]["out"]["index"] )
Gaffer.Metadata.registerValue( __children["Switch"]["in"], 'noduleLayout:section', 'top' )
Gaffer.Metadata.registerValue( __children["Switch"]["out"], 'noduleLayout:section', 'bottom' )
__children["Switch"]["__uiPosition"].setValue( imath.V2f( 12.2830076, -5.55000019 ) )
__children["ContextVariableTweaks"]["tweaks"]["tweak0"].setInput( __children["Spreadsheet_plugTest"]["out"]["tweakPlug_ContextVar_test"] )
Gaffer.Metadata.registerValue( __children["ContextVariableTweaks"]["in"], 'noduleLayout:section', 'top' )
Gaffer.Metadata.registerValue( __children["ContextVariableTweaks"]["out"], 'noduleLayout:section', 'bottom' )
__children["ContextVariableTweaks"]["__uiPosition"].setValue( imath.V2f( 11.8183117, 14.3999996 ) )
Gaffer.Metadata.registerValue( __children["rows"], 'description', 'Holds a child RowPlug for each row in the spreadsheet.' )
Gaffer.Metadata.registerValue( __children["rows"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["rows"][0], 'description', 'The default row. This provides output values when no other\nrow matches the `selector`.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["name"], 'description', "The name of the row. This is matched against the `selector`\nto determine which row is chosen to be passed to the output.\nMay contain multiple space separated names and any of Gaffer's\nstandard wildcards." )
Gaffer.Metadata.registerValue( __children["rows"][0]["enabled"], 'description', 'Enables or disables this row. Disabled rows are ignored.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"], 'description', 'Contains a child CellPlug for each column in the spreadsheet.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'spreadsheet:columnWidth', 169 )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'description', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'spreadsheet:columnLabel', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'plugValueWidget:type', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'presetsPlugValueWidget:allowCustom', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'presetNames', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"], 'presetValues', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"], 'noduleLayout:label', 'tweakPlug_test' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"], 'plugValueWidget:type', 'GafferSceneUI.ShaderTweaksUI._ShaderTweakPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"], 'noduleLayout:visible', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"]["name"], 'description', 'The name of the parameter to apply the tweak to.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'description', "| Mode | Description |\n| :--- | :---------- |\n| Create | Sets the value of a parameter, creating it if it doesn't exist yet. |\n| Create If Missing | Like `Create`, but does nothing if the parameter already exists. |\n| Replace | Replaces an existing parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. When replacing a string parameter, the new value may contain a `{source}` token, which will be substituted with the original value. |\n| Remove | Removes an existing parameter. Does not error if the property doesn't exist. |\n| Add | Adds to an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Subtract | Subtracts from an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Multiply | Multiplies an existing numeric parameter. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Min | Sets an existing numeric parameter to the minimum of its current value and the tweak value. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Max | Sets an existing numeric parameter to the maximum of its current value and the tweak value. Errors if the parameter doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n" )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"]["mode"], 'plugValueWidget:type', 'GafferUI.PresetsPlugValueWidget' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_test"]["value"]["value"], 'noduleLayout:label', 'tweakPlug_test' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'spreadsheet:columnWidth', 224 )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'description', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'spreadsheet:columnLabel', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'plugValueWidget:type', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'presetsPlugValueWidget:allowCustom', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'presetNames', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"], 'presetValues', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["NameValuePlug_test"]["value"], 'nameValuePlugPlugValueWidget:ignoreNamePlug', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'spreadsheet:columnLabel', 'boolPlug_test' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'spreadsheet:columnWidth', 130 )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'description', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'plugValueWidget:type', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'presetsPlugValueWidget:allowCustom', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'presetNames', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"], 'presetValues', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"]["value"], 'description', 'The index of the input which is passed through. A value\nof 0 chooses the first input, 1 the second and so on. Values\nlarger than the number of available inputs wrap back around to\nthe beginning.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["index"]["value"], 'nodule:type', '' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'spreadsheet:columnWidth', 204 )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'presetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'presetValues:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'ui:scene:acceptsSetName:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'ui:scene:acceptsSetNames:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'ui:scene:acceptsSetExpression:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'renameable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'deletable:promotable', False )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'description', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'spreadsheet:columnLabel', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'plugValueWidget:type', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'presetsPlugValueWidget:allowCustom', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'presetNames', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"], 'presetValues', None )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"]["value"]["name"], 'description', 'The name of the context variable to apply the tweak to.' )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"]["value"]["mode"], 'description', "| Mode | Description |\n| :--- | :---------- |\n| Create | Sets the value of a context variable, creating it if it doesn't exist yet. |\n| Create If Missing | Like `Create`, but does nothing if the context variable already exists. |\n| Replace | Replaces an existing context variable. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. When replacing a string context variable, the new value may contain a `{source}` token, which will be substituted with the original value. |\n| Remove | Removes an existing context variable. Does not error if the property doesn't exist. |\n| Add | Adds to an existing numeric context variable. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Subtract | Subtracts from an existing numeric context variable. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Multiply | Multiplies an existing numeric context variable. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Min | Sets an existing numeric context variable to the minimum of its current value and the tweak value. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n| Max | Sets an existing numeric context variable to the maximum of its current value and the tweak value. Errors if the context variable doesn't exist, unless `ignoreMissing` is set, in which case the tweak is skipped. |\n" )
Gaffer.Metadata.registerValue( __children["rows"][0]["cells"]["tweakPlug_ContextVar_test"]["value"]["mode"], 'plugValueWidget:type', 'GafferUI.PresetsPlugValueWidget' )
del __children
Note that the "tweakPlug_test" mode is set to "Subtract". If you then call root['spreadSheetPromotion'].exportForReference(myFilePath)
and reload the box you will notice the mode is now set to "replace".
This happens even if the default value of the mode on the mode plug is set to "Subtract" since neither the default for the mode plug, nor the value is serialised during the exportForReference
. I am guessing for this to work, the TweakPlug needs a more custom serialisation to handle the possiblity of a different default Mode or some other way to handle the Mode plug where it is no longer a plug created in the init of the TweakPlug but instead, treated in the same way as the ValuePlug that is passed to the TweakPlug. Any help is appreciated.