User Guide Cancel

resource | Substance 3D Automation ToolKit

  1. Substance 3D home
  2. Home
  3. Command Line Tools
    1. Command Line overview
    2. sbsbaker
      1. sbsbaker overview
      2. sbsbaker command line options
      3. sbsbaker Example Command Lines
    3. sbscooker
      1. sbscooker overview
      2. sbscooker command line options
      3. sbscooker pattern variables
    4. sbsmtools
      1. sbsmtools overview
      2. sbsmtools command line options
    5. sbsmutator
      1. sbsmutator overview
      2. sbsmutator command line options
      3. sbsmutator Example Command Lines
    6. sbsrender
      1. sbsrender overview
      2. sbsrender base parameters and pattern variables
      3. sbsrender command line options
      4. sbsrender example command lines
    7. sbsupdater
      1. sbsupdater overview
      2. sbsupdater command line options
  4. Pysbs - Python API
    1. Pysbs - Python API overview
    2. Getting started
    3. General topics
      1. Basic manipulation
      2. Substance creation
      3. Substances modification
      4. Dependencies management
      5. PySbs batchtools module
      6. metadata manipulation
      7. SAT demos
      8. Edit sbsar with SBSARManager
      9. Spot Colors
      10. Thumbnail creation with SAT
    4. Examples
      1. demohelloworld
      2. demos
      3. demos_batchtools
      4. script_update_with_sbsupdater
    5. API Content
      1. API Content overview
      2. Substance definitions
        1. Common interfaces
          1. basegraph
          2. package
          3. sbsarobject
          4. sbsobject
        2. compnode
          1. compnode overview
          2. common
          3. compimplementation
          4. paramgraph
        3. context projectmgr
        4. graph
          1. graph overview
          2. function
          3. inputparameters
          4. output
        5. mdl
          1. mdlannotation
          2. mdlcommon
          3. mdldictionaries
          4. mdlenum
          5. mdlgraph
          6. mdllibclasses
          7. mdlmanager
          8. mdlnode
          9. mdlnodeimpl
          10. mdloperand
          11. mdlsbsbridge
        6. modelgraphindex
          1. modelannotationnames
          2. modelgraph
          3. modelgraphgenerator
          4. modelgraphimplementation
          5. modelnodenames
          6. modeloperand
          7. modulegraphindex
          8. moduleannotation
          9. moduleconnection
          10. modulegraph
          11. modulegraphgenerator
          12. modulegraphimplementation
          13. modulegraphlibrary
          14. modulegraphregister
          15. modulenode
          16. modulenodeimplementation
          17. modulenodeinstance
          18. moduleoperand
          19. moduleoutputbridging
          20. moduleparaminput
        7. params
          1. params overview
          2. dynamicvalue
          3. paramnode
        8. projectmgrdoc
        9. sbsarchive
          1. sbsarchive overview
          2. sbsarenum
          3. sbsargraph
          4. sbsargui
          5. sbsarguiwidgets
          6. sbsarmanager
        10. sbscommon
          1. connections
          2. gui
          3. nodes
          4. values
        11. sbspreset
        12. sbsproject
        13. substance
          1. substance overview
          2. content
          3. resource
      3. Libraries
        1. sbsenum
        2. sbslibrary
          1. sbslibrary overview
          2. sbsdictionaries
          3. sbsfilters
          4. sbsfunctions
          5. sbsfxmapnodes
          6. sbslibclasses
          7. sbswidgets
        3. sbsbakerslibrary
          1. sbsbakerslibrary overview
          2. sbsbakersdef
          3. sbsbakersdefaultprops
          4. sbsbakersdictionaries
          5. sbsbakersenum
          6. sbsbakingconverter
          7. sbsbakingconverterparam
          8. sbsbakingparameters
          9. sbsdialogstate
          10. sbsscenedata
        4. Helpers
          1. sbscleaner
          2. sbsexporter
          3. sbsgenerator
          4. sbsparser
          5. sbswriter
          6. qtclasses
            1. qtclasses overview
            2. qtvariantreader
            3. qtvariantwriter
          7. psdparser
          8. sbsimpactmanager
          9. batchtools
          10. autograph
            1. ag_functions
            2. ag_layout
            3. ag_types
          11. info_mesh_parser
          12. sbsbaker_info_handlers
          13. sbsrender_render_handlers
          14. output_handlers
          15. spotcolorinfo_handler
          16. thumbnail
          17. batchtools overview
        5. Execution context
          1. context
          2. functions
        6. API Change log
  5. Samples
    1. Samples overview
    2. Texturing Template Demo
    3. Batch Tools Demo
    4. Variations
    5. Texture Mat
    6. Pixel Processor Ray tracer
  6. Setup and Getting Started
    1. Setup and Getting Started overview
    2. Compatibility
    3. Frequently asked Questions
    4. Known issues
    5. SAT Cookbook
    6. Use Pysbs in different python interpreter (maya, sd, blender...)
  7. Integrations
    1. Substance Maya toolset
      1. Substance Maya Toolset overview
      2. Installing
      3. Launching
      4. Baking
        1. Baking overview
        2. Export parameters
        3. Baker parameters
        4. Mesh setup
        5. Using a template
      5. Changelog
  8. Changelog overview

resource

 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 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 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)  

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)  

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)  

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 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 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)  

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)  

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='')  

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 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 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)  

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)  

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)  

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 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 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()  

Get the source, accordingly to the kind of source

 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)  

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)  

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 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 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)  

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)  

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

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

Get the attributes allowed on a SBSResource

Returns:the list of attribute enumeration allowed (AttributesEnum)
 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)  

Get the given attribute value

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

Set the given attribute

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

Set the given attributes

Parameters:aAttributes (dictionary in the format {AttributesEnum : value}) – The attributes to set
 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)  
 setCookedFormat(aCookedFormat)  
 getPkgResourcePath()  

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

Returns:The path as a string
 getResolvedFilePath()  

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

Returns:The path as a string
 getOption(aOptionName)  

Get the option identified by the given name

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

Get all the options defined on this resource

Returns:a list of SBSOption
 getBakingOptions()  

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

Returns:a list of SBSOption
 getSceneOptions()  

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

Returns:a list of SBSOption
 getSceneInfoOptions()  

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

Returns:a list of SBSOption
 setOptions(aOptions)  
 getResourceTypeEnum()  
Returns:the resource type as a ResourceTypeEnum if defined, None otherwise
 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()  

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)  

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()  
Returns:True if the resource is just linked with its path to the document (by opposition to imported)
 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()  

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)  

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)  

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 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 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)  

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)  

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()  

Get the list of material entries of this scene resource

Returns:a list of SBSSceneMaterialMapEntry
 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)  

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()  

Get the attributes allowed on a SBSResource

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

Get the given attribute value

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

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

Returns:a list of SBSOption
 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)  

Get the option identified by the given name

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

Get all the options defined on this resource

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

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

Returns:The path as a string
 getResolvedFilePath()  

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

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

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

Returns:a list of SBSOption
 getSceneOptions()  

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

Returns:a list of SBSOption
 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)  

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()  
Returns:True if the resource is just linked with its path to the document (by opposition to imported)
 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)  

Set the given attribute

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

Set the given attributes

Parameters:aAttributes (dictionary in the format {AttributesEnum : value}) – The attributes to set
 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)  

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)  
 setOptions(aOptions)  
 setPremultipliedAlpha(aIsPremultipliedAlpha)  
 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)  

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 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 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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

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)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that describe the affectations for a given UV-set

Members:
 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 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)  

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)  

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)  

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)  

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)  

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()  

Get the list of SBSUVSetMaterialMapEntry in this SBSUVSetMaterialMap

Returns:a list of SBSUVSetMaterialMapEntry
 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()  

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)  

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)  

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()  

Remove the entry (SBSUVSetMaterialMapEntry) associated by default

Returns:True if the UV-tile is found and removed, False otherwise
 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)  

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)  

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)  

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)  

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 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 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()  

Get the graph internal path associated to this UV-tile

Returns:the path as a string if defined, None otherwise
 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)  

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='')  

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 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 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)  

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)  

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)  

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 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 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)  

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)  

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

 Adobe

Get help faster and easier

New user?