sbsbakingconverter module
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)
Bases:
objectThis 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)
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 ConverterremoveUsedOptions (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()
Get all the parameters defined on this Baker
- Returns:
a list of
BakingParam
- getOverrideState(aParameter)
Get the given parameter override state
- Parameters:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to get- Returns:
The override state as a boolean if possible, None otherwise
- getParameter(aParameter)
Get the given parameter
- Parameters:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to get- Returns:
The parameter as a
QtVariantif found, None otherwise- Raise:
api_exceptions.SBSLibraryError
- getParameterValue(aParameter)
Get the value of the parameter with the given identifier
- Parameters:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to get- Returns:
The parameter value in the type of the parameter if found, None otherwise
- moveDown()
Move down this converter in the list of the parent baking parameters
- moveUp()
Move up this converter in the list of the parent baking parameters
- resetDefaultProperty(aParameter)
Reset the given overriden default property, to match the global default property of the Baking Parameters
- Parameters:
aParameter (
ConverterParamEnumor str) – The property to reset
- 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 (
ConverterParamEnumor str) – Identifier of the parameter to setaAbsPath (str) – The absolute path to the file resource
- Returns:
True if success, False otherwise
- Raise:
SBSImpossibleActionError
- 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 (
ConverterParamEnumor str) – Identifier of the parameter to setaPreviousBaker (
BakingConverteror str) – The converter to use (provide an BakingConverter object or an identifier)
- Returns:
True if success, False otherwise
- Raise:
SBSImpossibleActionError
- 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:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to setaResource (
SBSResource) – The resource to reference
- Returns:
True if success, False otherwise
- Raise:
SBSImpossibleActionError
- 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)
Set the value of the given parameter on this converter. Raise an exception if the parameter is not allowed on this converter.
- Parameters:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to setaParamValue (any type) – Value to set
- Returns:
Nothing
- Raise:
SBSImpossibleActionError
- setSelected(aSelected)
Select or deselect for the baking
- Parameters:
aSelected (bool) – True to select the converter, False to deselect it
- 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
SBSOptionsobject with the content of the BakingConverter
- updateDefaultProperties()
Update all the default properties that are not overriden, to match the global default properties of the Baking Parameters
- updateDefaultProperty(aParameter)
Update the given default property if it is not overriden, to match the global default property of the Baking Parameters
- Parameters:
aParameter (
ConverterParamEnumor str) – The property to update