User Guide Cancel

sbsbakingconverter | Substance 3D Automation ToolKit

sbsbakingconverter

Module sbsbakingconverter aims to provide the definition of a BakingConverter.

class pysbs.sbsbakers.sbsbakingconverter.BakingConverter(aIdentifier='', aConverterID='', aBakerType='imagemeshconverter', aIsSelected=True, aForcedOutputFormat=None, aCommonProperties=None, aProperties=None, aOverrides=None, aGlobalParams=None)
class pysbs.sbsbakers.sbsbakingconverter.BakingConverter(aIdentifier='', aConverterID='', aBakerType='imagemeshconverter', aIsSelected=True, aForcedOutputFormat=None, aCommonProperties=None, aProperties=None, aOverrides=None, aGlobalParams=None)
 class pysbs.sbsbakers.sbsbakingconverter.BakingConverter(aIdentifier='', aConverterID='', aBakerType='imagemeshconverter', aIsSelected=True, aForcedOutputFormat=None, aCommonProperties=None, aProperties=None, aOverrides=None, aGlobalParams=None)  

Bases: object

This class provide the definition of a Baking converter.

Members
  • mConverterID (str): id of the converter (unique)
  • mBakerType (str): Kind of converter, between ‘imagemeshconverter’ (default) and ‘vectorialmeshconverter’
  • mIdentifier (str): identifier of the converter
  • mIsSelected (bool): True to activate this baker. Default to True
  • mForcedOutputFormat (str): Allow to force a particular output format for this converter. Default to None
fromSBSTree(self, aIndexConverter, aSBSTree, removeUsedOptions = False)
fromSBSTree(self, aIndexConverter, aSBSTree, removeUsedOptions = False)
 fromSBSTree(self, aIndexConverter, aSBSTree, removeUsedOptions = False)  

Parse the given sbs tree to set the BakingConverter

Parameters:
  • aIndexConverter (int) – Index of this converter in the Baking Parameters
  • aSBSTree (SBSTree) – The tree of options to parse to build the Baking Converter
  • removeUsedOptions (bool, optional) – True to allow removing the options used to build this baker from the given list. Default to False
Returns:

True if success

getAllParameters()
getAllParameters()
 getAllParameters()  

Get all the parameters defined on this Baker

Returns:a list of BakingParam
getOverrideState(aParameter)
getOverrideState(aParameter)
 getOverrideState(aParameter)  

Get the given parameter override state

Parameters:aParameter (ConverterParamEnum or str) – Identifier of the parameter to get
Returns:The override state as a boolean if possible, None otherwise
getParameter(aParameter)
getParameter(aParameter)
 getParameter(aParameter)  

Get the given parameter

Parameters:aParameter (ConverterParamEnum or str) – Identifier of the parameter to get
Returns:The parameter as a QtVariant if found, None otherwise
Raise:api_exceptions.SBSLibraryError
getParameterValue(aParameter)
getParameterValue(aParameter)
 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
moveDown()
moveDown()
 moveDown()  

Move down this converter in the list of the parent baking parameters

moveUp()
moveUp()
 moveUp()  

Move up this converter in the list of the parent baking parameters

resetDefaultProperty(aParameter)
resetDefaultProperty(aParameter)
 resetDefaultProperty(aParameter)  

Reset the given overriden default property, to match the global default property of the Baking Parameters

Parameters:aParameter (ConverterParamEnum or str) – The property to reset
setFileParameterValueFromPath(aParameter, aAbsPath)
setFileParameterValueFromPath(aParameter, aAbsPath)
 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:
  • aParameter (ConverterParamEnum or str) – Identifier of the parameter to set
  • aAbsPath (str) – The absolute path to the file resource
Returns:

True if success, False otherwise

Raise:

SBSImpossibleActionError

setFileParameterValueFromPreviousBaker(aParameter, aPreviousBaker)
setFileParameterValueFromPreviousBaker(aParameter, aPreviousBaker)
 setFileParameterValueFromPreviousBaker(aParameter, aPreviousBaker)  

Set the file path value of the given parameter as the relative path of the given resource. Only parameters ‘NORMAL_MAP’, ‘TEXTURE_FILE’, ‘DIRECTION_FILE’ can be set by this function. An exception will be raised if the parameter is not appropriate or if the converter is invalid.

Parameters:
  • aParameter (ConverterParamEnum or str) – Identifier of the parameter to set
  • aPreviousBaker (BakingConverter or str) – The converter to use (provide an BakingConverter object or an identifier)
Returns:

True if success, False otherwise

Raise:

SBSImpossibleActionError

setFileParameterValueFromResource(aParameter, aResource)
setFileParameterValueFromResource(aParameter, aResource)
 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’, ‘MESH__SKEW_MAP’, ‘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:

SBSImpossibleActionError

setGlobalParams(aGlobalParams)
setGlobalParams(aGlobalParams)
 setGlobalParams(aGlobalParams)  

Set the reference to the parent Global Parameters

Parameters:aGlobalParams (BakingParameters) – The global parameters that include this converter
Returns:Nothing
setParameterValue(aParameter, aParamValue)
setParameterValue(aParameter, aParamValue)
 setParameterValue(aParameter, aParamValue)  

Set the value of the given parameter on this converter. Raise an exception if the parameter is not allowed on this converter.

Parameters:
  • aParameter (ConverterParamEnum or str) – Identifier of the parameter to set
  • aParamValue (any type) – Value to set
Returns:

Nothing

Raise:

SBSImpossibleActionError

setSelected(aSelected)
setSelected(aSelected)
 setSelected(aSelected)  

Select or deselect for the baking

Parameters:aSelected (bool) – True to select the converter, False to deselect it
toSBSOptionList(aIndexConverter)
toSBSOptionList(aIndexConverter)
 toSBSOptionList(aIndexConverter)  

Convert the object structure of the BakingConverter into a list of sbs options, as it is saved in the .sbs file

Parameters:aIndexConverter (int) – Index of this converter in the Baking Parameters
Returns:A list of SBSOptions object with the content of the BakingConverter
updateDefaultProperties()
updateDefaultProperties()
 updateDefaultProperties()  

Update all the default properties that are not overriden, to match the global default properties of the Baking Parameters

updateDefaultProperty(aParameter)
updateDefaultProperty(aParameter)
 updateDefaultProperty(aParameter)  

Update the given default property if it is not overriden, to match the global default property of the Baking Parameters

Parameters:aParameter (ConverterParamEnum or str) – The property to update

Get help faster and easier

New user?