- 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
sbsbakingparameters
Module sbsbakingparameters aims to provide useful functions to read and modify the baking parameters of a Scene resource.
The baking parameters are saved as an encoded string in the .sbs file, this is why a specific module is required for them.
class pysbs.sbsbakers.sbsbakingparameters.BakingParameters(aBakers=None, aSubMeshColors=None, aSubMeshSelections=None)
Bases: object
Class that contains information on the Baking Parameters of a Scene resource
- Members:
- mBakers (list of
BakingConverter
): list of BakingConverters - mSubMeshColors (list of
SubMeshColor
): list of SubMeshColor - mSubMeshSelections (list of
SubMeshSelection
): list of SubMeshSelection - mOutputProperties (list of
BakingGlobalParam
): list of global output properties - mDefaultProperties (list of
BakingGlobalParam
): list of global default properties - mMeshProperties (list of
BakingGlobalParam
): list of global mesh properties
- mBakers (list of
addBaker(aIdentifier)
Add a BakingConverter of the given kind
Parameters: | aIdentifier (BakerEnum ) – Identifier of the converter to create |
---|---|
Returns: | The created BakingConverter object |
Raise: | SBSImpossibleActionError |
addHighDefinitionMeshFromFile(aAbsFilePath)
Add the given absolute path to the list of High Definition Meshes for a ‘From Mesh’ converter. This modifies the parameter MESH__HIGH_DEF_MESHES of this converter.
Parameters: | aAbsFilePath (str) – The absolute path to the resource |
---|---|
Returns: | True if success, False otherwise |
Raise: | SBSImpossibleActionError |
addHighDefinitionMeshFromResource(aResource)
Add the given resource in the list of High Definition Meshes for a ‘From Mesh’ converter. The resource must be already included in the package. This modifies the parameter MESH__HIGH_DEF_MESHES of this converter.
Parameters: | aResource (SBSResource ) – The resource to reference |
---|---|
Returns: | True if success, False otherwise |
Raise: | SBSImpossibleActionError |
computeUniqueIdentifier(aIdentifier, aSuffixId = 0)
Check if the given identifier is already used and generate a unique identifier if necessary
Parameters: |
|
---|---|
Returns: | A unique identifier, which is either the given one or a new one with a suffix: identifier [id] |
fromSBSTree(aSBSTree)
Get the content of the given SBSTree to set the Baking Parameters
Parameters: | aSBSTree (SBSTree ) – The tree of options ot baking parameters from |
---|---|
Returns: | True if success |
getBaker(aBaker)
Get the BakingConverter object with the given identifier (ex: ‘Ambient Occlusion’)
Parameters: | aBaker (BakerEnum or str) – Identifier of the baker |
---|---|
Returns: | The BakingConverter with this identifier if found, None otherwise |
getNbBakers()
Get the number of BakingConverter defined
Returns: | The number of BakingConverter as an integer |
---|
getParameter(aParameter)
Get the global parameter with the given identifier
Parameters: | aParameter (ConverterParamEnum or str) – Identifier of the parameter to get |
---|---|
Returns: | The parameter as a QtVariant if found, None otherwise |
getParameterValue(aParameter)
Get the value of the parameter with the given identifier
Parameters: | aParameter (ConverterParamEnum or str) – Identifier of the parameter to get |
---|---|
Returns: | The parameter value in the type of the parameter if found, None otherwise |
getSubMeshColor(aEntityId, aSubMeshId)
Get the SubMeshColor corresponding to the given (entityId, subMeshId)
Returns: | The SubMeshColor object if found, None otherwise |
---|
getSubMeshColorHexa(aEntityId, aSubMeshId)
Get the hexadecimal color of the SubMeshColor corresponding to the given (entityId, subMeshId)
Parameters: |
|
---|---|
Returns: | The hexadecimal color as a string if it exists, None otherwise |
getSubMeshSelection(aEntityId, aSubMeshId)
Get the SubMeshSelection corresponding to the given (entityId, subMeshId)
Returns: | The SubMeshSelection object if found, None otherwise |
---|
isSubMeshSelected(aEntityId, aSubMeshId)
Check if the given (entityId, subMeshId) is selected
Parameters: |
|
---|---|
Returns: | True if the given submesh index is selected, False otherwise |
moveDownBaker(aBaker)
Move down the given baker in the bakers list
Parameters: | aBaker (BakingConverter or BakerEnum or str) – Baker to move down in the bakers list |
---|---|
Raise: | SBSImpossibleActionError |
moveUpBaker(aBaker)
Move up the given baker in the bakers list
Parameters: | aBaker (BakingConverter or BakerEnum or str) – Baker to move up in the bakers list |
---|---|
Raise: | SBSImpossibleActionError |
removeBaker(aBaker)
Remove the given baker
Parameters: | aBaker (BakingConverter or BakerEnum or str) – Baker to remove, as an object or an identifier |
---|---|
Returns: | True if success, False otherwise |
Raise: | SBSImpossibleActionError |
selectBaker(aBaker, aSelected=True)
Select the given baker
Parameters: |
|
---|---|
Raise: |
|
setFileParameterValueFromPath(aParameter, aAbsPath)
Set the file path value of the given parameter as the relative path of the given resource. Only parameters ‘MESH__CAGE_FILE’, ‘MESH__SKEW_MAP’, ‘NORMAL_MAP’, ‘TEXTURE_FILE’, ‘DIRECTION_FILE’ can be set by this function. An exception will be raised if the parameter is not appropriate.
Parameters: |
|
---|---|
Returns: | True if success, False otherwise |
Raise: |
|
setFileParameterValueFromResource(aParameter, aResource)
Set the file path value of the given parameter as the relative path of the given resource. Only parameters ‘MESH__CAGE_FILE’, ‘NORMAL_MAP’, ‘TEXTURE_FILE’, ‘DIRECTION_FILE’ can be set by this function. An exception will be raised if the resource is invalid or if the parameter is not appropriate.
Parameters: |
|
---|---|
Returns: | True if success, False otherwise |
Raise: |
|
setParameterValue(aParameter, aParamValue)
Set the value of the given global parameter
Parameters: |
|
---|---|
Raise: |
|
setSubMeshColorHexa(aEntityId, aSubMeshId, aColor)
Set the given color to the SubMesh part of the given Id
Parameters: |
|
---|---|
Returns: | Nothing |
Raise: |
|
setSubMeshSelection(aEntityId, aSubMeshId, aSelected)
Set the given color to the SubMesh part of the given Id
Parameters: |
|
---|
toSBSOptionList()
Convert the object structure of the BakingParameters into a tree of SBSOptions, as it is saved in the .sbs file
Returns: | A list of SBSOptions object with the content of the BakingParameters |
---|