User Guide Cancel

connections | Substance 3D Automation ToolKit

connections

Module connections provides the definition of the classes SBSConnection and SBSConnectionSplitpoint, which define the connection between two nodes (compositing nodes, function nodes or FxMap nodes)

class sbscommon.connections.SBSConnection(aIdentifier='', aEntry=None, aConnRef=None, aConnRefOutput=None, aSplitpoints=None)
class sbscommon.connections.SBSConnection(aIdentifier='', aEntry=None, aConnRef=None, aConnRefOutput=None, aSplitpoints=None)
 class sbscommon.connections.SBSConnection(aIdentifier='', aEntry=None, aConnRef=None, aConnRefOutput=None, aSplitpoints=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a connection as defined in a .sbs file

Members:
  • mIdentifier (str): input identifier. Among sbslibrary.__dict_CompNodeInputs, sbslibrary.__dict_FunctionInputs or free string.
  • mEntry (str, deprecated): entry identifier, specific to SBSCompNode type.
  • mConnRef (str): uid of the node (/compNode/uid) connected to this input.
  • mConnRefOutput (str, optional): uid of the output of the node connected to this input (/compNode/compOutputs/compOutput/uid). Present only if the node has multiple outputs.
  • mSplitpoints (list of SBSConnectionSplitpoint): splitpoint list.
equals(other)
equals(other)
 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.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
getConnectedNodeOutputUID()
getConnectedNodeOutputUID()
 getConnectedNodeOutputUID()  

Get the UID of the connected output (member mConnRefOutput).

Returns:The UID as a string if defined, None otherwise.
getConnectedNodeUID()
getConnectedNodeUID()
 getConnectedNodeUID()  

Get the UID of the connected node (member mConnRef).

Returns:The UID as a string if defined, None otherwise.
getUidIsUsed(aUID)
getUidIsUsed(aUID)
 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
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
setConnection(aConnRefValue, aConnRefOutputValue = None)
setConnection(aConnRefValue, aConnRefOutputValue = None)
 setConnection(aConnRefValue, aConnRefOutputValue = None)  

Set the connection.

Parameters:
  • aConnRefValue (str) – The UID of node to connect from
  • aConnRefOutputValue (str, optional) – The UID of the output of this node to connect. Can be None if the node has only one output.
write(aSBSWriter, aXmlNode)
write(aSBSWriter, aXmlNode)
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill
class sbscommon.connections.SBSConnectionSplitpoint(aScenePos='')
class sbscommon.connections.SBSConnectionSplitpoint(aScenePos='')
 class sbscommon.connections.SBSConnectionSplitpoint(aScenePos='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a splitpoint of a connection as defined in a .sbs file

Members:
  • mScenePos (str): splitpoint scene position.
equals(other)
equals(other)
 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.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
getUidIsUsed(aUID)
getUidIsUsed(aUID)
 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
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
write(aSBSWriter, aXmlNode)
write(aSBSWriter, aXmlNode)
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill
class sbscommon.connections.SBSGUIConnection(aIdentifier='', aConnRef='')
class sbscommon.connections.SBSGUIConnection(aIdentifier='', aConnRef='')
 class sbscommon.connections.SBSGUIConnection(aIdentifier='', aConnRef='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Visual connections only

Members:
  • mIdentifier (str): identifer.
  • mConnRef (str): id ref of the conenction.
equals(other)
equals(other)
 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.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
getUidIsUsed(aUID)
getUidIsUsed(aUID)
 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
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
write(aSBSWriter, aXmlNode)
write(aSBSWriter, aXmlNode)
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill
class sbscommon.connections.SBSRouting(aInput='', aOutput='')
class sbscommon.connections.SBSRouting(aInput='', aOutput='')
 class sbscommon.connections.SBSRouting(aInput='', aOutput='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Routing between input and output node used for disable option

Members:
  • mInput (str): input.
  • mOutput (str): output.
equals(other)
equals(other)
 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.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
getUidIsUsed(aUID)
getUidIsUsed(aUID)
 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
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
write(aSBSWriter, aXmlNode)
write(aSBSWriter, aXmlNode)
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill

Get help faster and easier

New user?