User Guide Cancel

resource | Substance 3D Automation ToolKit

resource

class substance.resource.SBSSourceExternalCopy(aFilename='')
class substance.resource.SBSSourceExternalCopy(aFilename='')
 class substance.resource.SBSSourceExternalCopy(aFilename='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a source external copy as defined in a .sbs file. External copy refers to an external file copied in a sub-folder of the application and entirely managed (iTunes style).

Members:
  • mFilename (str): name of the managed file.
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
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
class substance.resource.SBSSourceBinboon(aOffset='', aDatalength='', aFormat=None, aCompressedlength=None)
class substance.resource.SBSSourceBinboon(aOffset='', aDatalength='', aFormat=None, aCompressedlength=None)
 class substance.resource.SBSSourceBinboon(aOffset='', aDatalength='', aFormat=None, aCompressedlength=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a source binary file bounded to the package as defined in a .sbs file. Binboon refers to a file saved in a binary file bounded to this package.

Members:
  • mOffset (str): offset in the binary file in bytes.
  • mDatalength (str): length of the data in the binary file in bytes.
  • mFormat (str, optional): zlib, raw, etc.
  • mCompressedlength (str, optional): size of the compressed data (if applicable).
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
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
class substance.resource.SBSSourceBinembedded(aDatalength='', aFormat=None, aStrdata='')
class substance.resource.SBSSourceBinembedded(aDatalength='', aFormat=None, aStrdata='')
 class substance.resource.SBSSourceBinembedded(aDatalength='', aFormat=None, aStrdata='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a source binary file embedded to the package as defined in a .sbs file. Binembedded refers to a content embedded in the package file.

Members:
  • mDatalength (str): size of the binary data in bytes.
  • mFormat (str, optional): zlibbase64, rawbase64, etc.
  • mStrdata (str): data in base64 ASCII format.
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
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
class substance.resource.SBSSource(aExternalCopy=None, aBinBoon=None, aBinEmbedded=None)
class substance.resource.SBSSource(aExternalCopy=None, aBinBoon=None, aBinEmbedded=None)
 class substance.resource.SBSSource(aExternalCopy=None, aBinBoon=None, aBinEmbedded=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a source as defined in a .sbs file Embedded or managed source. The three children are exclusives.

Members:
  • mExternalCopy (SBSSourceExternalCopy): external file copied in a sub-folder of the application and entirely managed (iTunes style).
  • mBinBoon (SBSSourceBinboon): file saved in a binary file bounded to this package.
  • mBinEmbedded (SBSSourceBinembedded): content embedded in the package file.
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
getSource()
getSource()
 getSource()  

Get the source, accordingly to the kind of source

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
class substance.resource.SBSResource(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aTree=None, aFileAbsPath='', aRefDocument=None, aColorSpace=None, aPremultipliedAlpha=None)
class substance.resource.SBSResource(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aTree=None, aFileAbsPath='', aRefDocument=None, aColorSpace=None, aPremultipliedAlpha=None)
 class substance.resource.SBSResource(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aTree=None, aFileAbsPath='', aRefDocument=None, aColorSpace=None, aPremultipliedAlpha=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

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

Members:
  • mIdentifier (str): identifier of the file.
  • mUID (str): unique identifier of this resource in the package/ context.
  • mType (str): type of the resource (‘bitmap’,’svg’,…)
  • mFormat (str): original format of the resource (e.g. BMP, JPG for bitmap type resources).
  • mColorSpace (str, optional): colorspace transformation to apply based on ocio config file.
  • mPremultipliedAlpha (bool, optional): alpha is premultiplied or not.
  • mCookedFormat (str, optional): format of the resource after the cooking stage (among BitmapFormatEnum for bitmap resources)
  • mCookedQuality (float as a string, optional): quality of resource after the cooking stage (percentage for a bitmap type with a cookedFormat JPEG).
  • mFilePath (str): path and name of the origin file.
  • mAttributes (SBSAttributes): various attributes (author, description, …)
  • mSource (SBSSource): embedded or managed source.
  • mOptions (SBSOption): additional options.
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
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.
resolveDependency(aSBSDocument)
resolveDependency(aSBSDocument)
 resolveDependency(aSBSDocument)  

Allow to resolve the dependency of the resource on the root package that contains it.

Parameters:aSBSDocument (SBSDocument) – The root document
getAllowedAttributes()
getAllowedAttributes()
 getAllowedAttributes()  

Get the attributes allowed on a SBSResource

Returns:the list of attribute enumeration allowed (AttributesEnum)
static isAllowedExtension(aExtension)
static isAllowedExtension(aExtension)
 static isAllowedExtension(aExtension)  

Check if the given extension is allowed for this type of resource

Parameters:
  • aResourceType (ResourceTypeEnum or str) – the kind of resource to consider
  • aExtension (str) – the extension to check (ex: ‘.png’)
Returns:

True if this extension is allowed for this kind of resource, False otherwise

getAttribute(aAttributeIdentifier)
getAttribute(aAttributeIdentifier)
 getAttribute(aAttributeIdentifier)  

Get the given attribute value

Parameters:aAttributeIdentifier (AttributesEnum) – the attribute identifier
Returns:the attribute value if defined, None otherwise
setAttribute(aAttributeIdentifier, aAttributeValue)
setAttribute(aAttributeIdentifier, aAttributeValue)
 setAttribute(aAttributeIdentifier, aAttributeValue)  

Set the given attribute

Parameters:
  • aAttributeIdentifier (AttributesEnum) – The attribute identifier to set
  • aAttributeValue (str) – The attribute value to set
setAttributes(aAttributes)
setAttributes(aAttributes)
 setAttributes(aAttributes)  

Set the given attributes

Parameters:aAttributes (dictionary in the format {AttributesEnum : value}) – The attributes to set
setColorSpace(aColorSpace, aContext)
setColorSpace(aColorSpace, aContext)
 setColorSpace(aColorSpace, aContext)  

Set colorspace value to apply to the resource bitmap :param aColorSpace: str colorspace value :param aContext: str colorspace value :type aContext: aContext Context :return:

setPremultipliedAlpha(aIsPremultipliedAlpha)
setPremultipliedAlpha(aIsPremultipliedAlpha)
 setPremultipliedAlpha(aIsPremultipliedAlpha)  
setCookedFormat(aCookedFormat)
setCookedFormat(aCookedFormat)
 setCookedFormat(aCookedFormat)  
getPkgResourcePath()
getPkgResourcePath()
 getPkgResourcePath()  

Get the path of the resource relatively to its parent package (pkg:///).

Returns:The path as a string
getResolvedFilePath()
getResolvedFilePath()
 getResolvedFilePath()  

Get the path of the resource relatively to its parent package (SBSDocument)

Returns:The path as a string
getOption(aOptionName)
getOption(aOptionName)
 getOption(aOptionName)  

Get the option identified by the given name

Returns:the option as a SBSOption if found, None otherwise
getOptions()
getOptions()
 getOptions()  

Get all the options defined on this resource

Returns:a list of SBSOption
getBakingOptions()
getBakingOptions()
 getBakingOptions()  

Get all the options related to the baking parameters on this resource

Returns:a list of SBSOption
getSceneOptions()
getSceneOptions()
 getSceneOptions()  

Get all the options related to the 3D Scene on this resource

Returns:a list of SBSOption
getSceneInfoOptions()
getSceneInfoOptions()
 getSceneInfoOptions()  

Get all the options related to the 3D Scene information on this resource

Returns:a list of SBSOption
setOptions(aOptions)
setOptions(aOptions)
 setOptions(aOptions)  
getResourceTypeEnum()
getResourceTypeEnum()
 getResourceTypeEnum()  
Returns:the resource type as a ResourceTypeEnum if defined, None otherwise
createBakingParameters()
createBakingParameters()
 createBakingParameters()  

Create the baking parameters for this Scene resource, and init all required values. No converter is added by default.

Returns:The BakingParameters object created
Raise:api_exceptions.SBSImpossibleActionError
getBakingParameters()
getBakingParameters()
 getBakingParameters()  

Decode the baking parameters option and convert it into an editable object structure

Returns:The baking parameters as a BakingParameters object if defined, None otherwise
setBakingParameters(aBakingParameters)
setBakingParameters(aBakingParameters)
 setBakingParameters(aBakingParameters)  

Set the given baking parameters on this resource. The function converts the baking parameters into a list of SBSOptions, as saved in .sbs format. All the previous options related to Baking Parameters will be removed before creating the new ones. Raise an exception if the resource is not a Scene.

Parameters:aBakingParameters (BakingParameters) – The baking parameters to set
Returns:Nothing
Raise:api_exceptions.SBSImpossibleActionError
isLinked()
isLinked()
 isLinked()  
Returns:True if the resource is just linked with its path to the document (by opposition to imported)
setResourceIsBakingOutput(aBakedSceneResource, aBaker)
setResourceIsBakingOutput(aBakedSceneResource, aBaker)
 setResourceIsBakingOutput(aBakedSceneResource, aBaker)  

Declare this Bitmap resource as the output of a Baking process

Parameters:
  • aBakedSceneResource (SBSResourceScene) – The scene resource used to bake maps
  • aBaker (BakerEnum or str) – The baker used (as a BakerEnum or an identifier, for instance ‘Curvature Map from Mesh [2]’)
Returns:

getPhysicalResourceList()
getPhysicalResourceList()
 getPhysicalResourceList()  

Get the list of physical files associated to this resource. This allow for the particular case of a resource pointing to the output of a baking with Udims, to get the list of corresponding files.

Returns:a list of string
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
class substance.resource.SBSResourceScene(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aOptions=None, aFileAbsPath='', aRefDocument=None, aIsUdim=None, aSceneMaterialMap=None)
class substance.resource.SBSResourceScene(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aOptions=None, aFileAbsPath='', aRefDocument=None, aIsUdim=None, aSceneMaterialMap=None)
 class substance.resource.SBSResourceScene(aIdentifier='', aUID='', aType='', aFormat='', aCookedFormat=None, aCookedQuality=None, aFilePath='', aAttributes=None, aSource=None, aOptions=None, aFileAbsPath='', aRefDocument=None, aIsUdim=None, aSceneMaterialMap=None)  

Bases: substance.resource.SBSResource

Class that contains information on a substance scene/mesh resource as defined in a .sbs file

Members:
  • mIdentifier (str): identifier of the file.
  • mUID (str): unique identifier of this resource in the package/ context.
  • mType (str): type of the resource (‘bitmap’,’svg’,…)
  • mFormat (str): original format of the resource (e.g. BMP, JPG for bitmap type resources).
  • mCookedFormat (str, optional): format of the resource after the cooking stage (among BitmapFormatEnum for bitmap resources)
  • mCookedQuality (float as a string, optional): quality of resource after the cooking stage (percentage for a bitmap type with a cookedFormat JPEG).
  • mFilePath (str): path and name of the origin file.
  • mAttributes (SBSAttributes): various attributes (author, description, …)
  • mSource (SBSSource): embedded or managed source.
  • mOptions (SBSOption): additional options.
  • mIsUdim (str, optional): flag indicating whether this scene must be managed as a mesh unwrapped on multiple UV-tiles
  • mSceneMaterialMap (list of SBSSceneMaterialMapEntry): An associative list that store material-graph affectation for the scene resource.
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
setMaterialMapEntries(aMaterialsList, nbUVSet=1)
setMaterialMapEntries(aMaterialsList, nbUVSet=1)
 setMaterialMapEntries(aMaterialsList, nbUVSet=1)  

Init the material map entries given the list of materials of the mesh resource.

Parameters:
  • aMaterialsList (list of str) – list of material names
  • nbUVSet (int, optional) – number of UV-sets of the mesh. Default to 1
getMaterialMapEntry(aMaterialName)
getMaterialMapEntry(aMaterialName)
 getMaterialMapEntry(aMaterialName)  

Get the material map entry corresponding to the given material name

Parameters:aMaterialName (str) – The material name to look for
Returns:a SBSSceneMaterialMapEntry if found, None otherwise
getMaterialMapEntries()
getMaterialMapEntries()
 getMaterialMapEntries()  

Get the list of material entries of this scene resource

Returns:a list of SBSSceneMaterialMapEntry
createBakingParameters()
createBakingParameters()
 createBakingParameters()  

Create the baking parameters for this Scene resource, and init all required values. No converter is added by default.

Returns:The BakingParameters object created
Raise:api_exceptions.SBSImpossibleActionError
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.
getAllowedAttributes()
getAllowedAttributes()
 getAllowedAttributes()  

Get the attributes allowed on a SBSResource

Returns:the list of attribute enumeration allowed (AttributesEnum)
getAttribute(aAttributeIdentifier)
getAttribute(aAttributeIdentifier)
 getAttribute(aAttributeIdentifier)  

Get the given attribute value

Parameters:aAttributeIdentifier (AttributesEnum) – the attribute identifier
Returns:the attribute value if defined, None otherwise
getBakingOptions()
getBakingOptions()
 getBakingOptions()  

Get all the options related to the baking parameters on this resource

Returns:a list of SBSOption
getBakingParameters()
getBakingParameters()
 getBakingParameters()  

Decode the baking parameters option and convert it into an editable object structure

Returns:The baking parameters as a BakingParameters object if defined, None otherwise
getOption(aOptionName)
getOption(aOptionName)
 getOption(aOptionName)  

Get the option identified by the given name

Returns:the option as a SBSOption if found, None otherwise
getOptions()
getOptions()
 getOptions()  

Get all the options defined on this resource

Returns:a list of SBSOption
getPhysicalResourceList()
getPhysicalResourceList()
 getPhysicalResourceList()  

Get the list of physical files associated to this resource. This allow for the particular case of a resource pointing to the output of a baking with Udims, to get the list of corresponding files.

Returns:a list of string
getPkgResourcePath()
getPkgResourcePath()
 getPkgResourcePath()  

Get the path of the resource relatively to its parent package (pkg:///).

Returns:The path as a string
getResolvedFilePath()
getResolvedFilePath()
 getResolvedFilePath()  

Get the path of the resource relatively to its parent package (SBSDocument)

Returns:The path as a string
getResourceTypeEnum()
getResourceTypeEnum()
 getResourceTypeEnum()  
Returns:the resource type as a ResourceTypeEnum if defined, None otherwise
getSceneInfoOptions()
getSceneInfoOptions()
 getSceneInfoOptions()  

Get all the options related to the 3D Scene information on this resource

Returns:a list of SBSOption
getSceneOptions()
getSceneOptions()
 getSceneOptions()  

Get all the options related to the 3D Scene on this resource

Returns:a list of SBSOption
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
static isAllowedExtension(aExtension)
static isAllowedExtension(aExtension)
 static isAllowedExtension(aExtension)  

Check if the given extension is allowed for this type of resource

Parameters:
  • aResourceType (ResourceTypeEnum or str) – the kind of resource to consider
  • aExtension (str) – the extension to check (ex: ‘.png’)
Returns:

True if this extension is allowed for this kind of resource, False otherwise

isLinked()
isLinked()
 isLinked()  
Returns:True if the resource is just linked with its path to the document (by opposition to imported)
resolveDependency(aSBSDocument)
resolveDependency(aSBSDocument)
 resolveDependency(aSBSDocument)  

Allow to resolve the dependency of the resource on the root package that contains it.

Parameters:aSBSDocument (SBSDocument) – The root document
setAttribute(aAttributeIdentifier, aAttributeValue)
setAttribute(aAttributeIdentifier, aAttributeValue)
 setAttribute(aAttributeIdentifier, aAttributeValue)  

Set the given attribute

Parameters:
  • aAttributeIdentifier (AttributesEnum) – The attribute identifier to set
  • aAttributeValue (str) – The attribute value to set
setAttributes(aAttributes)
setAttributes(aAttributes)
 setAttributes(aAttributes)  

Set the given attributes

Parameters:aAttributes (dictionary in the format {AttributesEnum : value}) – The attributes to set
setBakingParameters(aBakingParameters)
setBakingParameters(aBakingParameters)
 setBakingParameters(aBakingParameters)  

Set the given baking parameters on this resource. The function converts the baking parameters into a list of SBSOptions, as saved in .sbs format. All the previous options related to Baking Parameters will be removed before creating the new ones. Raise an exception if the resource is not a Scene.

Parameters:aBakingParameters (BakingParameters) – The baking parameters to set
Returns:Nothing
Raise:api_exceptions.SBSImpossibleActionError
setColorSpace(aColorSpace, aContext)
setColorSpace(aColorSpace, aContext)
 setColorSpace(aColorSpace, aContext)  

Set colorspace value to apply to the resource bitmap :param aColorSpace: str colorspace value :param aContext: str colorspace value :type aContext: aContext Context :return:

setCookedFormat(aCookedFormat)
setCookedFormat(aCookedFormat)
 setCookedFormat(aCookedFormat)  
setOptions(aOptions)
setOptions(aOptions)
 setOptions(aOptions)  
setPremultipliedAlpha(aIsPremultipliedAlpha)
setPremultipliedAlpha(aIsPremultipliedAlpha)
 setPremultipliedAlpha(aIsPremultipliedAlpha)  
setResourceIsBakingOutput(aBakedSceneResource, aBaker)
setResourceIsBakingOutput(aBakedSceneResource, aBaker)
 setResourceIsBakingOutput(aBakedSceneResource, aBaker)  

Declare this Bitmap resource as the output of a Baking process

Parameters:
  • aBakedSceneResource (SBSResourceScene) – The scene resource used to bake maps
  • aBaker (BakerEnum or str) – The baker used (as a BakerEnum or an identifier, for instance ‘Curvature Map from Mesh [2]’)
Returns:

class substance.resource.SBSSceneMaterialMapEntry(aSceneMaterialName='', aUVSetMaterialMapList=None)
class substance.resource.SBSSceneMaterialMapEntry(aSceneMaterialName='', aUVSetMaterialMapList=None)
 class substance.resource.SBSSceneMaterialMapEntry(aSceneMaterialName='', aUVSetMaterialMapList=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains the description of the affections for a given material of the SBSResourceScene

Members:
  • mSceneMaterialName (str): the affected material name.
  • mUVSetMaterialMapList (list of SBSUVSetMaterialMap): a list that describe the affectations by UV-set
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
getAllUVTilesAssociatedToGraph(aGraphPath, aUVTileFormat=sbsenum.UVTileFormat.UDIM, aUVSet=0)
getAllUVTilesAssociatedToGraph(aGraphPath, aUVTileFormat=sbsenum.UVTileFormat.UDIM, aUVSet=0)
 getAllUVTilesAssociatedToGraph(aGraphPath, aUVTileFormat=sbsenum.UVTileFormat.UDIM, aUVSet=0)  

Get the list of UV-tiles associated to the given graph internal path (pkg://…), for the given UV-set.

Parameters:
  • aGraphPath (str) – The internal path of the graph to consider (pkg://…)
  • aUVTileFormat (UVTileFormat, optional) – The format desired for the UV-tiles. Default to UDIM
  • aUVSet (int, optional) – The index of the UV-set to consider. Default to 0
Returns:

the list of UV-tiles in the expected format

getUVSetMaterialMap(aUVSet = 0)
getUVSetMaterialMap(aUVSet = 0)
 getUVSetMaterialMap(aUVSet = 0)  

Get the uvSetMaterialMap corresponding to the given UV-set number, for the given UV-set.

Parameters:aUVSet (int, optional) – The index of the UV-set to consider. Default to 0
Returns:a SBSUVSetMaterialMap object if found, None otherwise
getUVSetMaterialMapEntry(aUVTile, aUVSet=0)
getUVSetMaterialMapEntry(aUVTile, aUVSet=0)
 getUVSetMaterialMapEntry(aUVTile, aUVSet=0)  

Get the uvSetMaterialMapEntry corresponding to the given UV-tile and UV-set, for the given UV-set.

Parameters:
  • aUVTile (str) – Id of the UV-tile to get, as saved in the .sbs format (‘0x0’ for instance), or ‘all’ to ge the material map entry corresponding to all UV-tiles
  • aUVSet (int, optional) – The index of the UV-set to consider. Default to 0
Returns:

a SBSUVSetMaterialMapEntry if found, None otherwise

getUVSetMaterialMapEntries(aUVSet=0)
getUVSetMaterialMapEntries(aUVSet=0)
 getUVSetMaterialMapEntries(aUVSet=0)  

Get the list of SBSUVSetMaterialMapEntry in this SBSUVSetMaterialMap, for the given UV-set.

Parameters:aUVSet (int, optional) – The index of the UV-set to consider. Default to 0
Returns:a list of SBSUVSetMaterialMapEntry
assignDefaultSBSGraph(aGraphPath, aUVSet=0)
assignDefaultSBSGraph(aGraphPath, aUVSet=0)
 assignDefaultSBSGraph(aGraphPath, aUVSet=0)  

Assign the given SBSGraph as the default for all UV-tiles.

Parameters:
  • aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

the SBSUVSetMaterialMapEntry corresponding to the assignment

assignSBSGraphToUVTile(aGraphPath, aUVTile, aUVSet=0)
assignSBSGraphToUVTile(aGraphPath, aUVTile, aUVSet=0)
 assignSBSGraphToUVTile(aGraphPath, aUVTile, aUVSet=0)  

Assign the given UV-tile to the given SBSGraph, for the given UV-set.

Parameters:
  • aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
  • aUVTile (str, list or tuple) – The UV-tile to affect (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) ), or ‘all’ to assign this graph to all UV-tiles
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

the SBSUVSetMaterialMapEntry corresponding to the assignment

assignSBSGraphToUVTiles(aGraphPath, aUVTileList, aUVSet=0)
assignSBSGraphToUVTiles(aGraphPath, aUVTileList, aUVSet=0)
 assignSBSGraphToUVTiles(aGraphPath, aUVTileList, aUVSet=0)  

Assign the given list of UV-tile to the given SBSGraph, for the given UV-set.

Parameters:
  • aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
  • aUVTileList (list) – The list of UV-tiles to affect (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) )
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

the list of SBSUVSetMaterialMapEntry corresponding to the assignments

removeAllAssignationsToGraph(aGraphPath, aUVSet=0)
removeAllAssignationsToGraph(aGraphPath, aUVSet=0)
 removeAllAssignationsToGraph(aGraphPath, aUVSet=0)  

Remove all the entries (SBSUVSetMaterialMapEntry) associated to the given graph, in the given UV-set.

Parameters:
  • aGraphPath (str) – The internal path of the graph to consider (pkg://…)
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

the number of entries removed

removeDefaultUVTileAssignation(aUVSet=0)
removeDefaultUVTileAssignation(aUVSet=0)
 removeDefaultUVTileAssignation(aUVSet=0)  

Remove the entry (SBSUVSetMaterialMapEntry) associated by default, in the given UV-set.

Parameters:aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:True if the UV-tile is found and removed, False otherwise
removeUVTileAssignation(aUVTile, aUVSet=0)
removeUVTileAssignation(aUVTile, aUVSet=0)
 removeUVTileAssignation(aUVTile, aUVSet=0)  

Remove the entry (SBSUVSetMaterialMapEntry) associated to the given UV-tile, in the given UV-set.

Parameters:
  • aUVTile (string, list or tuple) – The UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) ), or ‘all’ to look for the default assignation
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

True if the UV-tile is found and removed, False otherwise

removeUVTilesAssignation(aUVTileList, aUVSet=0)
removeUVTilesAssignation(aUVTileList, aUVSet=0)
 removeUVTilesAssignation(aUVTileList, aUVSet=0)  

Remove the entries (SBSUVSetMaterialMapEntry) associated to the given UV-tile list, in the given UV-set.

Parameters:
  • aUVTileList (list) – The list of UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) )
  • aUVSet (int, optional) – The index of the UV-set to modify. Default to 0
Returns:

the number of entries removed

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
class substance.resource.SBSUVSetMaterialMap(aEntries=None, aOptionsByGraph=None)
class substance.resource.SBSUVSetMaterialMap(aEntries=None, aOptionsByGraph=None)
 class substance.resource.SBSUVSetMaterialMap(aEntries=None, aOptionsByGraph=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that describe the affectations for a given UV-set

Members:
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
assignDefaultSBSGraph(aGraphPath)
assignDefaultSBSGraph(aGraphPath)
 assignDefaultSBSGraph(aGraphPath)  

Assign the given SBSGraph as the default for all UV-tiles.

Parameters:aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
Returns:the SBSUVSetMaterialMapEntry corresponding to the assignment
assignSBSGraphToUVTile(aGraphPath, aUVTile)
assignSBSGraphToUVTile(aGraphPath, aUVTile)
 assignSBSGraphToUVTile(aGraphPath, aUVTile)  

Assign the given SBSGraph to the given UV-tile.

Parameters:
  • aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
  • aUVTile (str, list or tuple) – The UV-tile to affect (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) ), or ‘all’ to assign this graph to all UV-tiles
Returns:

the SBSUVSetMaterialMapEntry corresponding to the assignment

assignSBSGraphToUVTiles(aGraphPath, aUVTileList)
assignSBSGraphToUVTiles(aGraphPath, aUVTileList)
 assignSBSGraphToUVTiles(aGraphPath, aUVTileList)  

Assign the given SBSGraph to the given list of UV-tile.

Parameters:
  • aGraphPath (str) – The compositing graph to assign, given its internal path (pkg:///myGraph)
  • aUVTileList (list) – The list of UV-tiles to affect (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) )
Returns:

the list of SBSUVSetMaterialMapEntry corresponding to the assignments

getAllEntriesAssociatedToGraph(aGraphPath)
getAllEntriesAssociatedToGraph(aGraphPath)
 getAllEntriesAssociatedToGraph(aGraphPath)  

Get the list of entries associated to the given graph internal path (pkg://…)

Parameters:aGraphPath (str) – The internal path of the graph to consider (pkg://…)
Returns:a list of SBSUVSetMaterialMapEntry
getAllUVTilesAssociatedToGraph(aGraphPath, UVTileFormat = sbsenum.UVTileFormat.UDIM)
getAllUVTilesAssociatedToGraph(aGraphPath, UVTileFormat = sbsenum.UVTileFormat.UDIM)
 getAllUVTilesAssociatedToGraph(aGraphPath, UVTileFormat = sbsenum.UVTileFormat.UDIM)  

Get the list of UV-tiles associated to the given graph internal path (pkg://…)

Parameters:
  • aGraphPath (str) – The internal path of the graph to consider (pkg://…)
  • aUVTileFormat (UVTileFormat, optional) – The format desired for the UV-tiles. Default to UDIM
Returns:

the list of UV-tiles in the expected format

getUVSetMaterialMapEntries()
getUVSetMaterialMapEntries()
 getUVSetMaterialMapEntries()  

Get the list of SBSUVSetMaterialMapEntry in this SBSUVSetMaterialMap

Returns:a list of SBSUVSetMaterialMapEntry
getUVSetMaterialMapEntry(aUVTile)
getUVSetMaterialMapEntry(aUVTile)
 getUVSetMaterialMapEntry(aUVTile)  

Get the SBSUVSetMaterialMapEntry corresponding to this UVTile

Parameters:aUVTile (string, list or tuple) – The UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) ), or ‘all’ to look for the default assignation
Returns:a SBSUVSetMaterialMapEntry if found, None otherwise
getGraphAssignedByDefault()
getGraphAssignedByDefault()
 getGraphAssignedByDefault()  

Get the path of the graph assigned by default to all UV-tiles

Returns:the graph internal path as a string if found, None otherwise
getGraphAssignedToUVTile(aUVTile)
getGraphAssignedToUVTile(aUVTile)
 getGraphAssignedToUVTile(aUVTile)  

Get the path of the graph assigned to this UVTile

Parameters:aUVTile (string, list or tuple) – The UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) )
Returns:the graph internal path as a string if found, None otherwise
removeAllAssignationsToGraph(aGraphPath)
removeAllAssignationsToGraph(aGraphPath)
 removeAllAssignationsToGraph(aGraphPath)  

Remove all the entries (SBSUVSetMaterialMapEntry) associated to the given graph

Parameters:aGraphPath (str) – The internal path of the graph to consider (pkg://…)
Returns:the number of entries removed
removeDefaultUVTileAssignation()
removeDefaultUVTileAssignation()
 removeDefaultUVTileAssignation()  

Remove the entry (SBSUVSetMaterialMapEntry) associated by default

Returns:True if the UV-tile is found and removed, False otherwise
removeUVTileAssignation(aUVTile)
removeUVTileAssignation(aUVTile)
 removeUVTileAssignation(aUVTile)  

Remove the entry (SBSUVSetMaterialMapEntry) associated to the given UV-tile

Parameters:aUVTile (string, list or tuple) – The UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) ), or ‘all’ to look for the default assignation
Returns:True if the UV-tile is found and removed, False otherwise
removeUVTilesAssignation(aUVTileList)
removeUVTilesAssignation(aUVTileList)
 removeUVTilesAssignation(aUVTileList)  

Remove the entries (SBSUVSetMaterialMapEntry) associated to the given UV-tile list

Parameters:aUVTileList (list) – The list of UV-tile to look for (different format accepted: ‘UDIM’, ‘u{U}_v{V}’, ‘{U}x{V}’, [U,V], (U,V) )
Returns:the number of entries removed
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
class substance.resource.SBSUVSetMaterialMapEntry(aUVTiles='all', aMaterial=None)
class substance.resource.SBSUVSetMaterialMapEntry(aUVTiles='all', aMaterial=None)
 class substance.resource.SBSUVSetMaterialMapEntry(aUVTiles='all', aMaterial=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that associate a graph to one or more UV-tile

Members:
  • mUVTiles (str): a formatted string that list the UV-tiles of this entry. Might be “all” or the UV-tile coordinate formatted as “{U}x{V}”
  • mMaterial (SBSUVSetMaterial): the description of the affected material.
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
getGraphPath()
getGraphPath()
 getGraphPath()  

Get the graph internal path associated to this UV-tile

Returns:the path as a string if defined, None otherwise
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
class substance.resource.SBSUVSetMaterial(aSBSGraphUrl='')
class substance.resource.SBSUVSetMaterial(aSBSGraphUrl='')
 class substance.resource.SBSUVSetMaterial(aSBSGraphUrl='')  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains the description of the affected material. It only contains a reference to a graph at the moment, but it may be extended in the future.

Members:
  • mSBSGraphUrl (str): path of the graph definition.
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
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
class substance.resource.SBSOptionsByUrlMapEntry(aURL='', aOptions=None)
class substance.resource.SBSOptionsByUrlMapEntry(aURL='', aOptions=None)
 class substance.resource.SBSOptionsByUrlMapEntry(aURL='', aOptions=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that list options for a graph in the context of the parent SBSUVSetMaterialMap.

Members:
  • mURL (str): path of the graph definition to which the options apply.
  • mOptions (list of SBSOption, optional): the options associated with this graph in the current context.
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
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

Get help faster and easier

New user?