- 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
paramnode
Module paramnode provides the definition of the class SBSFuncData
and SBSParamNode
which compose a function graph.
class params.paramnode.SBSFuncData(aName='', aConstantValue=None)
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Class that contains information on a function data as defined in a .sbs file
- Members:
- mName (str): identifier of the data.
- mConstantValue (
SBSConstantValue
): value.
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.
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 |
getValue()
Get the value of this function data
Returns: | The value as a string |
---|
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
class params.paramnode.SBSParamNode(aGUIName=None, aUID='', aFunction='', aDisabled=None, aType=None, aConnections=None, aFuncDatas=None, aGUILayout=None, aRefFunction=None, aRefDependency=None)
Bases: pysbs.sbscommon.nodes.SBSNode
Class that contains information on a parameter node as defined in a .sbs file. A SBSParamNode represents a function node. It is included in the definition of a SBSDynamicValue
, and it can be connected to other SBSParamNode.
- Members:
- mGUIName (str, optional): name of the node.
- mUID (str): unique identifier in the dynamicValue/paramNodes/ context.
- mFunction (str): identifier of the function, among the available identifiers as defined in
sbsfunctions
. - mDisabled (str, optional): this node is disabled (“1” / None).
- mType (str, optional): return type of the node, if the node can handle multiple types.
- mConnections (list of
SBSConnection
, optional): input connections list. - mFuncDatas (list of
SBSFuncData
): additional data list. - mGUILayout (
SBSGUILayout
): GUI position of the node in the function graph. - mRefFunction (
SBSFunction
, optional): in the case of an instance function node, reference to the function it represents.
changeDependencyUID(aSBSDocument, newDepUID)
Change the UID of the dependency referenced by this instance.
Parameters: |
|
---|
changeInstancePath(aParentDocument, aInstanceDocument, aFunctionRelPath)
Change the function referenced by this instance. If aInstanceDocument is not already declared as a dependency, the dependency will be added to aParentDocument.
Parameters: |
|
---|
classify(aOther)
Use the definition of the two nodes to classify them, and their GUI position if they have the same definition. The function identifier is used to classify them. At a final option, the GUI position is used, and in this case, mostLeft < mostRight and then mostUp < mostDown.
Parameters: |
|
---|---|
Returns: | 1 if itself is considered greater than the other node, -1 for the opposite. 0 in case of equality. |
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.
getConnectedNodesUID()
Get the UIDs of the nodes connected to this node.
Returns: | The UIDs as a list of string |
---|
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 function node definition (Inputs, Outputs, Parameters)
Returns: | a FunctionDef object |
---|
getDependencyUID()
If this node is an instance of a Function, get the UID of the dependency referenced by this instance.
Returns: | The dependency UID as a string if found, None otherwise |
---|
getDisplayName()
Get the display name of this node
Returns: | the display name as a string |
---|
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 |
getOutputType()
Returns: | The output type of the function node. In case of a template, return the value of the template |
---|
getParameterValue(aParameter = None)
Find a parameter with the given name/id among the function datas of this ParamNode. If aParameter is None, return the parameter with the name of the function.
Parameters: | aParameter (sbsenum.Function or str, optional) – Parameter identifier |
---|---|
Returns: | The parameter value if found, None otherwise |
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 |
---|
getReferenceAbsPath()
If this function node is an instance, get the absolute path of the function referenced by this instance.
Returns: | The absolute path of the function referenced by this instance, in the format absolutePath/filename.sbs/functionIdentifier, as a string |
---|
getReferenceInternalPath()
If this function node is an instance, get the path of the function relatively to the package (pkg:///).
Returns: | The path as a string |
---|
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 |
isAnInstance()
Check if this SBSParamNode is of kind ‘instance’
Returns: | True if this node is a function node ‘instance’, 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 |
resolveDependency(aSBSDocument)
Allow to resolve the dependency of the function instance node with the function it references.
Parameters: | aSBSDocument (SBSDocument ) – The root document |
---|
setParameterValue(aParameter, aParamValue)
Set the value of the given parameter to the given value, if compatible with this type of Function
Parameters: |
|
---|---|
Returns: | True if succeed |
Raise: |
|
setPosition(aPosition)
Set the position of this node in the graph GUI.
Parameters: | aPosition (a list of 3 float) – The position to set |
---|
setType()
Set a new param type
Returns: | aParamTypeEnum |
---|
unsetParameter(aParameter)
Unset the given parameter so that it is reset to its default value.
Parameters: | aParameter (CompNodeParamEnum or str) – identifier of the parameter to set |
---|---|
Returns: | True if succeed, False otherwise |
Raise: | api_exceptions.SBSLibraryError |
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|