- 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
values
Module values provides the definition of the classes relative to the value of parameters in the .sbs file: - SBSConstantValue
- SBSOption
- SBSIcon
- SBSAttributes
class sbscommon.values.SBSAttributes(aCategory=None, aLabel=None, aAuthor=None, aAuthorURL=None, aTags=None, aDescription=None, aUserTags=None, aIcon=None, aHideInLibrary=None, aPhysicalSize=None)
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Class that contains information on attributes as defined in a .sbs file
- Members:
- mAuthor (str, optional): author information.
- mAuthorURL (str, optional): author url.
- mCategory (str, optional): data category. Slash separated strings.
- mDescription (str, optional): textual description.
- mHideInLibrary (str, optional): whether or not the object is hidden in library.
- mIcon (
SBSIcon
, optional): icon. - mLabel (str, optional): user label.
- mPhysicalSize (str, optional): the physical size (float3) of a graph.
- mTags (str, optional): tags as comma separated strings.
- mUserTags (str, optional): user information useful for the 3D engine using the substance engine (UNICODE string).
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.
getAttribute(aAttributeIdentifier)
Get the given attribute value
Parameters: | aAttributeIdentifier (AttributesEnum ) – the attribute identifier |
---|---|
Returns: | the attribute value if defined, None otherwise |
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 |
hasAttributes()
- Check if at least one attribute is defined among:
- ‘category’, ‘label’, ‘author’, ‘authorURL’, ‘tags’, ‘description’, ‘usertags’, ‘icon’, ‘hideInLibrary’, ‘physicalSize’
Returns: | True if at least one attribute is defined, False otherwise |
---|
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
setAttribute(self, aAttributeIdentifier, aAttributeValue)
Set the given attribute value
Parameters: |
|
---|
setAttributes(aAttributes, aParentObject)
Set the given attributes
Parameters: |
|
---|
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
class sbscommon.values.SBSConstantValue(aConstantValue=None, aTagName='')
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Class that contains information on a constant value as defined in a .sbs file
- Members:
- mConstantValue (str): simple constant definition of a parameter.
- mTagName (str): the tag name in the .sbs file, in the format ‘constantvalue’
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.
getType()
Get the type of this constant value
Returns: | The type as a ParamTypeEnum if success, None otherwise |
---|
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 constant value.
Returns: | The value as a string if defined, None otherwise |
---|
static isValidValue(aType, aValue)
setConstantValue(aType, aValue, aInt1 = False) Set the constant value to the given value, and set the tagname accordingly to the type of the value.
Parameters: |
|
---|
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
setConstantValue(aType, aValue, aInt1 = False)
Set the constant value to the given value, and set the tagname accordingly to the type of the value.
Parameters: |
|
---|
updateConstantValue(aValue)
Update the value.
Parameters: | aValue (str) – the value to set |
---|
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
class sbscommon.values.SBSIcon(aDataLength='', aFormat='', aStrdata='')
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Class that contains information on an icon as defined in a .sbs file. An icon can be added in the attributes section of a graph.
- Members:
- mDataLength (str): length of the icon image data.
- mFormat (str): icon format.
- mStrdata (str): icon image data.
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 |
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 sbscommon.values.SBSOption(aName='', aValue='')
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Class that contains information on an option that can appear in a substance graph / compNode
- Members:
- mName (str): name of the option
- mValue (str): value of the option
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 |
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 sbscommon.values.SBSTree(aTreeElements=None)
Bases: pysbs.common_interfaces.sbsobject.SBSObject
Tree of options in the resource scene
- Members:
- mTreeElements (collections.OrderedDict): Ordered dict of options with their name as ey
asOptionList()
Recursively turns a tree into a list of options with paths. The options will have a name on the form a/b/c and a value representing the string at the leaf :return: [SBSOption]
asStringList()
Returns the content of a tree representing a vector (meaning it has a size element and the indices as keys) :return: [str]
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.
getChildByName(aName)
Returns a child node based on its name. Returns None if the child doesn’t exist :param aName: The name of the child to ask for :type aName: str :return: SBSTree SBSTreeList, SBSTreeStr, SBSTreeUrl or None if not found
getChildByPath(aPath)
Queries a child by a path in a hierarchy of SBSTree and nodes :param aPath: The path to the child queried in the format a/b/c where a and b are SBStrees and c is the name of the element asked for :type aPath: str :return: SBSTree SBSTreeList, SBSTreeStr, SBSTreeUrl or None if not found
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 recursively the given xml node to retrieve the content of the SBSObject.
setChildByPath(aPath, aValue, asURL=False)
Sets a child by a path in a hierarchy of SBSTree and nodes :param aPath: The path to the child queried in the format a/b/c where a and b are SBStrees and c is the name of the element to set If the element set already exists it will be overwritten by the new value :type aPath: str :param aValue: a string representing the value to set :type aValue: str :param asURL: Optional parameter to say whether the value should be created as an SBSTreeStr or SBSTreeUrl :type asURL: bool
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
class sbscommon.values.SBSTreeList(aName='', aElements=None)
Bases: pysbs.common_interfaces.sbsobject.SBSObject
List of options in the resource scene tree. Currently used in resource scenes
- Members:
- mName (str): name of the option
- aElements (list): a list of options to populate the list with
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 |
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 sbscommon.values.SBSTreeStr(aName='', aValue='')
Bases: pysbs.common_interfaces.sbsobject.SBSObject
A string option. Currently used in resource scenes
- Members:
- mName (str): name of the option
- mValue (str): value of the option
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 |
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 sbscommon.values.SBSTreeUrl(aName='', aValue='')
Bases: pysbs.common_interfaces.sbsobject.SBSObject
A url option. Currently used in resource scenes
- Members:
- mName (str): name of the option
- mValue (str): value of the option
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 |
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: |
|
---|