User Guide Cancel

mdlsbsbridge | Substance 3D Automation ToolKit

mdlsbsbridge

Module mdlsbsbridge aims to define SBSObjects that are relative to a Substance graph instance in a MDL graph, mostly:

class mdl.mdlsbsbridge.MDLInputBridging(aLocalIdentifier='', aIdentifier='')
class mdl.mdlsbsbridge.MDLInputBridging(aLocalIdentifier='', aIdentifier='')
 class mdl.mdlsbsbridge.MDLInputBridging(aLocalIdentifier='', aIdentifier='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information of an input bridging of a MDLImplSBSInstance as defined in a .sbs file.

Members:
  • mLocalIdentifier (str): Local identifier of the input
  • mIdentifier (str): Identifier of the input
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 mdl.mdlsbsbridge.MDLOutputBridging(aUID='', aIdentifier='')
class mdl.mdlsbsbridge.MDLOutputBridging(aUID='', aIdentifier='')
 class mdl.mdlsbsbridge.MDLOutputBridging(aUID='', aIdentifier='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information of an output bridging of a MDLImplSBSInstance as defined in a .sbs file.

Members:
  • mUID (str): UID of the output
  • mIdentifier (str): Identifier of the 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
class mdl.mdlsbsbridge.MDLParamValue(aValue=None, aTagName='')
class mdl.mdlsbsbridge.MDLParamValue(aValue=None, aTagName='')
 class mdl.mdlsbsbridge.MDLParamValue(aValue=None, aTagName='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a MDL parameter value as defined in a .sbs file

Members:
  • mValue (str): value of the parameter.
  • mTagName (str): the tag name associated to this parameter in the .sbs file (bool, int1,.., int4, float1,.., float4, string)
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.
getType()
getType()
 getType()  

Get the type of this value

Returns:The type as a ParamTypeEnum if success, None otherwise
getTypedValue()
getTypedValue()
 getTypedValue()  

Get the value in the type of the parameter (bool, int, …).

Returns:The value in the type of the parameter 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
getValue()
getValue()
 getValue()  

Get the value.

Returns:The value as a string if defined, None otherwise
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
setValue(aValue, aType=None)
setValue(aValue, aType=None)
 setValue(aValue, aType=None)  

Set the value, and if aType is specified, set the tagname accordingly to the type of the value. If aType is let None, keep the current type.

Parameters:
  • aValue (str) – the value to set
  • aType (ParamTypeEnum, optional) – type of the value
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 mdl.mdlsbsbridge.MDLParameter(aName='', aValue=None, aIsDefaultValue=None)
class mdl.mdlsbsbridge.MDLParameter(aName='', aValue=None, aIsDefaultValue=None)
 class mdl.mdlsbsbridge.MDLParameter(aName='', aValue=None, aIsDefaultValue=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information of a parameter of a Substance Graph instance inserted in a MDLGraph.

Members:
  • mName (str): name of the parameter.
  • mValue (MDLParamValue): value of this parameter.
  • mIsDefaultValue (str, optional): boolean indicating if the value of this parameter is the default one. Default to False
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.
getType()
getType()
 getType()  

Get the type of this parameter

Returns:the type of this parameter as a ParamTypeEnum if possible, None otherwise
getTypedValue()
getTypedValue()
 getTypedValue()  

Get the value in the type of the parameter (bool, int, …).

Returns:The value in the type of the parameter 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
getValue()
getValue()
 getValue()  

Get the value of this parameter

Returns:the value as a string if it exists, None otherwise
isDefaultValue()
isDefaultValue()
 isDefaultValue()  
Returns:True if this value is the default value of the parameter
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
setIsDefaultValue(isDefaultValue)
setIsDefaultValue(isDefaultValue)
 setIsDefaultValue(isDefaultValue)  

Set if this parameter has the default value or not.

Parameters:isDefaultValue (bool) – True to define that this parameter has the default value.
setValue(aValue, aType=None)
setValue(aValue, aType=None)
 setValue(aValue, aType=None)  

Set the value of this parameter, and if aType is specified, set its type too, otherwise let the current type.

Parameters:
  • aValue (any type, depends on the parameter type) – the value to affect
  • aType (ParamTypeEnum) – the type to affect
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?