def __outPlugNoduleCreator(plug): if isinstance(plug, Gaffer.CompoundPlug): return GafferUI.CompoundNodule(plug, GafferUI.LinearContainer.Orientation.Y, spacing=0.2) else: return GafferUI.StandardNodule(plug)
def __parameterNoduleCreator(plug): # only coshader parameters should be connectable in the node # graph. if plug.typeId() == Gaffer.Plug.staticTypeId(): return GafferUI.StandardNodule(plug) elif plug.typeId() == Gaffer.ArrayPlug.staticTypeId(): # coshader arrays tend to be used for layering, so we prefer to present the # last entry at the top, hence the increasing direction. return GafferUI.CompoundNodule( plug, GafferUI.LinearContainer.Orientation.Y, direction=GafferUI.LinearContainer.Direction.Increasing) return None
def __parametersNoduleCreator(plug): return GafferUI.CompoundNodule(plug, GafferUI.LinearContainer.Orientation.Y, spacing=0.2)
def noduleCreator(plug): if isinstance(plug, Gaffer.CompoundPlug): return GafferUI.CompoundNodule(plug) else: return GafferUI.StandardNodule(plug)
""" Output connections to downstream nodes which must not be executed until after this node. """, ), "dispatcher" : ( "description", """ Container for custom plugs which dispatchers use to control their behaviour. """, "nodeUI:section", "Dispatcher" ), } ) ########################################################################## # Metadata, PlugValueWidgets and Nodules ########################################################################## GafferUI.PlugValueWidget.registerCreator( Gaffer.ExecutableNode, "requirements", None ) GafferUI.Nodule.registerNodule( Gaffer.ExecutableNode, "requirements", lambda plug : GafferUI.CompoundNodule( plug, spacing = 0.4 ) )
def __previousAvailable(menu): scriptWindow = menu.ancestor(GafferUI.ScriptWindow) script = scriptWindow.scriptNode() return bool(__previous(script)) ########################################################################## # Metadata, PlugValueWidgets and Nodules ########################################################################## Gaffer.Metadata.registerPlugValue(Gaffer.Node, "despatcherParameters", "nodeUI:section", "Despatcher") GafferUI.PlugValueWidget.registerCreator(Gaffer.Node.staticTypeId(), "despatcherParameters", GafferUI.CompoundPlugValueWidget, collapsed=None) GafferUI.PlugValueWidget.registerCreator(Gaffer.Node.staticTypeId(), "requirements", None) GafferUI.PlugValueWidget.registerCreator(Gaffer.Node.staticTypeId(), "requirement", None) GafferUI.Nodule.registerNodule(Gaffer.Node.staticTypeId(), "despatcherParameters", lambda plug: None) GafferUI.Nodule.registerNodule( Gaffer.Node.staticTypeId(), "requirements", lambda plug: GafferUI.CompoundNodule(plug, spacing=0.4))
if not hasattr( script, "_executeUILastExecuted" ) : return [] result = [] for w in script._executeUILastExecuted : n = w() if n is not None : s = n.scriptNode() if s is not None and s.isSame( script ) : result.append( n ) return result def __previousAvailable( menu ) : scriptWindow = menu.ancestor( GafferUI.ScriptWindow ) script = scriptWindow.scriptNode() return bool( __previous( script ) ) ########################################################################## # Metadata, PlugValueWidgets and Nodules ########################################################################## GafferUI.Metadata.registerPlugValue( Gaffer.Node, "despatcherParameters", "nodeUI:section", "Despatcher" ) GafferUI.PlugValueWidget.registerCreator( Gaffer.Node.staticTypeId(), "despatcherParameters", GafferUI.CompoundPlugValueWidget, collapsed = None ) GafferUI.PlugValueWidget.registerCreator( Gaffer.Node.staticTypeId(), "requirements", None ) GafferUI.Nodule.registerNodule( Gaffer.Node.staticTypeId(), "despatcherParameters", lambda plug : None ) GafferUI.Nodule.registerNodule( Gaffer.Node.staticTypeId(), "requirements", lambda plug : GafferUI.CompoundNodule( plug, spacing = 0.4 ) )