User Guide Cancel

modulegraphgenerator | Substance 3D Automation ToolKit

modulegraphgenerator

Module modelgrapgenerator factory module to create various models entities

modulegraph.modulegraphgenerator.createConnection(aModuleRegister, aNodeLeft: modulenode.ModuleNode, aNodeRight: modulenode.ModuleNode, aOutputIdentifer: str=None, aInputIdentifer: str=None)
modulegraph.modulegraphgenerator.createConnection(aModuleRegister, aNodeLeft: modulenode.ModuleNode, aNodeRight: modulenode.ModuleNode, aOutputIdentifer: str=None, aInputIdentifer: str=None)
 modulegraph.modulegraphgenerator.createConnection(aModuleRegister, aNodeLeft: modulenode.ModuleNode, aNodeRight: modulenode.ModuleNode, aOutputIdentifer: str=None, aInputIdentifer: str=None)  

Connect two nodes by their outputs to inputs, in model graph all inputs are operands. If output and input identifier are not set first of each will be used. Currently there is no type check during the connection, so as long as the output and input exists the connection will be done but could be not valid for the evaluation.

Parameters:
  • aNodeLeft (ModuleNode) – the left node
  • aNodeRight (ModuleNode) – the right node, which received connection
  • aOutputIdentifer (str) – the output pin’s identifier, in the case where the left node has several output
  • aInputIdentifer (str) – the input pin’s identifier, in the case where the right node has several input
Returns:

the connection object

Return type:

ModuleConnection

modulegraph.modulegraphgenerator.createEmptyNode(aGraph: modulegraph.ModuleGraph, aPos=(0, 0, 0))
modulegraph.modulegraphgenerator.createEmptyNode(aGraph: modulegraph.ModuleGraph, aPos=(0, 0, 0))
 modulegraph.modulegraphgenerator.createEmptyNode(aGraph: modulegraph.ModuleGraph, aPos=(0, 0, 0))  

Create an empty node, the basic shell that will received the implementation

Parameters:
  • aGraph (ModuleGraph) – the graph where the node will be created
  • aPos – a x, y, z position value
Returns:

ModuleNode

modulegraph.modulegraphgenerator.createFeatureVersion(aModuleRegister, aDoc)
modulegraph.modulegraphgenerator.createFeatureVersion(aModuleRegister, aDoc)
 modulegraph.modulegraphgenerator.createFeatureVersion(aModuleRegister, aDoc)  

Add a new FeatureVersion object to the doc :param aDoc: the document where the FeatureVersion will be created :type aDoc: SBSDocument :return: FeatureVersionOption

modulegraph.modulegraphgenerator.createGraph(aModuleRegister, aDoc, aIdentifier: str, aAttrName='mModuleGraphs', aParentFolder=None)
modulegraph.modulegraphgenerator.createGraph(aModuleRegister, aDoc, aIdentifier: str, aAttrName='mModuleGraphs', aParentFolder=None)
 modulegraph.modulegraphgenerator.createGraph(aModuleRegister, aDoc, aIdentifier: str, aAttrName='mModuleGraphs', aParentFolder=None)  

Create a basic module graph

Parameters:
  • aDoc (SBSDocument) – the document where the graph will be created
  • aIdentifier – the identifier / name of the graph
Returns:

ModuleGraph

modulegraph.modulegraphgenerator.createGraphAnnotation(aModuleRegister, aGraph: modulegraph.ModuleGraph, aKey: str, aValue)
modulegraph.modulegraphgenerator.createGraphAnnotation(aModuleRegister, aGraph: modulegraph.ModuleGraph, aKey: str, aValue)
 modulegraph.modulegraphgenerator.createGraphAnnotation(aModuleRegister, aGraph: modulegraph.ModuleGraph, aKey: str, aValue)  

Create an Annotation object and add it to the given graph Annotation handle graph information attributes like description, author, tags…

Parameters:
  • aGraph (ModuleGraph) – the graph where the node will be created
  • aKey (str) – the key word, title, path of the annotation, can be ‘description’, ‘author’ …
  • aValue (str) – the string value of the annotation
Returns:

annotation obj

Return type:

ModuleAnnotation

modulegraph.modulegraphgenerator.createNode(aGraph: modulegraph.ModuleGraph, aNodeId: str, aPos=(0, 0, 0))
modulegraph.modulegraphgenerator.createNode(aGraph: modulegraph.ModuleGraph, aNodeId: str, aPos=(0, 0, 0))
 modulegraph.modulegraphgenerator.createNode(aGraph: modulegraph.ModuleGraph, aNodeId: str, aPos=(0, 0, 0))  

Top def to create an atomic node (not an instance) by given a node id createNode(aModelgraph, “Structure::NodeBool”)

Parameters:
  • aGraph (ModuleGraph) – the graph where the node will be created
  • aNodeId – the path id of the node
  • aPos – a x, y, z position value
Returns:

ModuleNode

modulegraph.modulegraphgenerator.createNodeImplementation(aModuleRegister, aNodeId: str)
modulegraph.modulegraphgenerator.createNodeImplementation(aModuleRegister, aNodeId: str)
 modulegraph.modulegraphgenerator.createNodeImplementation(aModuleRegister, aNodeId: str)  

Create the node implementation object, the implementation class is retrieve by the register or use the default one ModuleNodeImplementation

Parameters:aNodeId (str) – the node identifier to retrieve info from register
Returns:the Node Implementation instance
Return type:ModuleNodeImplementation
modulegraph.modulegraphgenerator.createOperandValue(aModuleRegister, aNodeId: str, aOperandName: str, aValue=None)
modulegraph.modulegraphgenerator.createOperandValue(aModuleRegister, aNodeId: str, aOperandName: str, aValue=None)
 modulegraph.modulegraphgenerator.createOperandValue(aModuleRegister, aNodeId: str, aOperandName: str, aValue=None)  

Create ModuleOperand the corresponding operand from a node id and operand name :param aNodeId: the node identifier to retrieve info from register :type aNodeId: str :param aOperandName: the operand name :type aOperandName: str :param aValue: a value to give to the new operand :return: the operand instance :rtype: ModuleOperand

modulegraph.modulegraphgenerator.createOutputBridgings(aModuleRegister, aNodeImpl: modulenodeimplementation.ModuleNodeImplementation, aNodeId: str, aName: str)
modulegraph.modulegraphgenerator.createOutputBridgings(aModuleRegister, aNodeImpl: modulenodeimplementation.ModuleNodeImplementation, aNodeId: str, aName: str)
 modulegraph.modulegraphgenerator.createOutputBridgings(aModuleRegister, aNodeImpl: modulenodeimplementation.ModuleNodeImplementation, aNodeId: str, aName: str)  

Create OutputBridgings node, the outputs. From a node id and an output name :param aNodeImpl: A node implementation object :type aNodeImpl: ModuleNodeImplementation :param aNodeId: the node identifier to retrieve info from register :type aNodeId: str :param aName: output name :type aName: str :return: output bridging instance :rtype: ModuleOutputBridging

modulegraph.modulegraphgenerator.exposeNode(aModuleRegister, aGraph: modulegraph.ModuleGraph, aNode: modulenode.ModuleNode, aIdentifier: str, aDescription: str= '', aInGroup: str='', aDisplayName: str='', aGammaType: str='', aGraphDefinitionId: str=None, aSoftRange=None, aHardRange=None)
modulegraph.modulegraphgenerator.exposeNode(aModuleRegister, aGraph: modulegraph.ModuleGraph, aNode: modulenode.ModuleNode, aIdentifier: str, aDescription: str= '', aInGroup: str='', aDisplayName: str='', aGammaType: str='', aGraphDefinitionId: str=None, aSoftRange=None, aHardRange=None)
 modulegraph.modulegraphgenerator.exposeNode(aModuleRegister, aGraph: modulegraph.ModuleGraph, aNode: modulenode.ModuleNode, aIdentifier: str, aDescription: str= '', aInGroup: str='', aDisplayName: str='', aGammaType: str='', aGraphDefinitionId: str=None, aSoftRange=None, aHardRange=None)  

Expose as a graph input parameter a constant node

Parameters:
  • aGraph (ModuleGraph) – the graph where the input parameter will be created
  • aNode (ModuleNode) – the constant node to exposed as graph input
  • aIdentifier (str) – the identifier of the graph input parameter
  • aDescription (str) – Graph input description
  • aInGroup (str) – Graph input group
  • aDisplayName (str) – Graph input display name
  • aGammaType (str) – Graph input gamma type
  • aSoftRange (list) – a soft range for the graph parameter
  • aHardRange (list) – a hard range for the graph parameter
Returns:

ModuleParamInput

Get help faster and easier

New user?