- Substance 3D home
- Home
- Command Line Tools
- Command Line overview
- sbsbaker
- sbscooker
- sbsmtools
- sbsmutator
- sbsrender
- sbsupdater
- Command Line overview
- Pysbs - Python API
- Pysbs - Python API overview
- Getting started
- General topics
- Examples
- API Content
- API Content overview
- Substance definitions
- Common interfaces
- compnode
- context projectmgr
- graph
- mdl
- modelgraphindex
- modelannotationnames
- modelgraph
- modelgraphgenerator
- modelgraphimplementation
- modelnodenames
- modeloperand
- modulegraphindex
- moduleannotation
- moduleconnection
- modulegraph
- modulegraphgenerator
- modulegraphimplementation
- modulegraphlibrary
- modulegraphregister
- modulenode
- modulenodeimplementation
- modulenodeinstance
- moduleoperand
- moduleoutputbridging
- moduleparaminput
- params
- projectmgrdoc
- sbsarchive
- sbscommon
- sbspreset
- sbsproject
- substance
- Libraries
- sbsenum
- sbslibrary
- sbsbakerslibrary
- Helpers
- Execution context
- API Change log
- Samples
- Setup and Getting Started
- Integrations
- Substance Maya toolset
- Changelog overview
modulenode
Module modulenode aims to define SBSObjects that are relative to a module node, mostly ModuleNode
.
class modulegraph.modulenode.ModuleNode(aUID='', aNodeImplementation=None, aDisabled=None, aGUILayout=None, aConnections=None)
Bases: pysbs.sbscommon.nodes.SBSNode
Class that contains information on a MDL graph as defined in a .sbs file
- Members:
- mUID (str): unique identifier in the package/ context.
- mNodeImplementation (
ModuleNodeImplementation
): Module Node Implementation - mDisabled (str, optional): this node is disabled.
- mGUILayout (
SBSGUILayout
): GUI position/options
equals(other)
Check if this SBSObject is equivalent to the other SBSObject. Some members may be excluded from this check, the UIDs or GUILayout for instance.
getConnectedNodeUID(aInputOperand) → str
Return the connected’s UID node to the input operand
Parameters: | aInputOperand (str) – identifier/name of the input operand |
---|---|
Returns: | the connected node UID |
Return type: | str |
getConnectedNodesUID()
Get the UIDs of the nodes connected to this node.
Returns: | The UIDs as a list of string |
---|
getConnectedOperands() → List[pysbs.modulegraph.moduleoperand.ModuleOperand]
return connected operands :return: list of ModuleOperand
:rtype: list
getConnectionOnPin(aPinIdentifier)
Get the connection defined on the given input.
Parameters: | aPinIdentifier (str) – identifier of the input pin (for SBSCompNode , SBSParamNode and MDLNode ) or of the output pin(for SBSParamsGraphNode ) |
---|---|
Returns: | a SBSConnection object corresponding to the connection defined on the given pin. None otherwise |
getConnections()
Get the connections defined on this node.
Returns: | a list of SBSConnection |
---|
getConnectionsFromNode(aLeftNode)
Get all the connections coming from the given left node.
Parameters: | aLeftNode (SBSNode or str) – The node to look for in the incoming connections of this node, as an object or a UID |
---|---|
Returns: | a list of SBSConnection |
getDefinition()
Get the node definition (Inputs, Outputs, Parameters) accordingly to the node implementation
Returns: | a NodeDef object if defined, None otherwise |
---|
getDisplayName()
Get the display name of this node
Returns: | the display name as a string |
---|
getImplementation() → pysbs.modulegraph.modulenodeimplementation.ModuleNodeImplementation
getInputDefinition(self, aInputIdentifier=None)
Get the input definition corresponding to the given identifier.
Parameters: | aInputIdentifier (InputEnum or str, optional) – The identifier to get. If let None, the primary input will be returned |
---|---|
Returns: | the input definition as a CompNodeInput if found, None otherwise |
getOffsetPosition(aOffset = None)
Compute the position of this node offset by the given offset
Parameters: | aOffset (list of 2 float, optional) – the offset to apply to the node’s current position. Default to [0,0] |
---|---|
Returns: | the offset position |
getPosition()
Get the position of this node in the graph GUI.
Returns: | a list of 3 float |
---|
getRect()
Return the rectangle of this node.
Returns: | The rectangle as a Rect |
---|
getUidIsUsed(aUID)
Check if the given uid is already used in the context of this SBSObject.
Parameters: | aUID (str) – UID to check |
---|---|
Returns: | True if the uid is already used, False otherwise |
Raise: | AttributeError if the function getUidIsUsed in not properly overloaded on this SBSObject |
hasAReferenceOnDependency(aDependency)
Check if this node directly references the given dependency. For instance if it instantiates a graph or a resource included in this dependency.
Parameters: | aDependency (str or SBSDependency ) – The dependency to look for (UID or object) |
---|---|
Returns: | True if this node references this dependency, False otherwise |
hasAReferenceOnInternalPath(aInternalPath)
Check if this node references the given internal path (pkg:///). For instance if it instantiates the graph or the resource pointed at the given path.
Parameters: | aInternalPath (str) – The internal path to look for |
---|---|
Returns: | True if this node references the given internal path, False otherwise |
isConnectedTo(aLeftNode)
Check if the node is connected to the given node, in the direction aLeftNode -> self
Parameters: | aLeftNode (SBSNode or str (UID)) – The node to look for in the connections of this node. |
---|---|
Returns: | True if the nodes are connected, False otherwise |
isDocked()
Check if this node is docked.
Returns: | True if this node is docked, None otherwise |
---|
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
removeConnectionOnPin(aInput)
Remove the connection on the given input pin.
Parameters: | aPinIdentifier (InputEnum or FunctionInputEnum or str) – identifier of the input pin (for SBSCompNode and SBSParamNode ) or of the output pin(for SBSParamsGraphNode ) to disconnect |
---|---|
Returns: | True if a connection is removed, False otherwise |
removeConnectionsFrom(aLeftNode)
Remove all the connections from aLeftNode to this node (in the direction aLeftNode -> self)
Parameters: | aLeftNode (SBSNode or str (UID)) – The node to look for in the connections of this node. |
---|---|
Returns: | Nothing |
setPosition(aPosition)
Set the position of this node in the graph GUI.
Parameters: | aPosition (a list of 3 float) – The position to set |
---|
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|