sbsbakingparameters module
- class pysbs.sbsbakers.sbsbakingparameters.BakingParameters(aBakers=None, aSubMeshColors=None, aSubMeshSelections=None)
Bases:
objectClass that contains information on the Baking Parameters of a Scene resource
- Members:
mBakers (list of
BakingConverter): list of BakingConvertersmSubMeshColors (list of
SubMeshColor): list of SubMeshColormSubMeshSelections (list of
SubMeshSelection): list of SubMeshSelectionmOutputProperties (list of
BakingGlobalParam): list of global output propertiesmDefaultProperties (list of
BakingGlobalParam): list of global default propertiesmMeshProperties (list of
BakingGlobalParam): list of global mesh properties
- addBaker(aIdentifier)
Add a BakingConverter of the given kind
- Parameters:
aIdentifier (
BakerEnum) – Identifier of the converter to create- Returns:
The created
BakingConverterobject- 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:
aIdentifier (str) – Identifier to check
aSuffixId (int) – Suffix ID
- 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 (
BakerEnumor str) – Identifier of the baker- Returns:
The
BakingConverterwith 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 (
ConverterParamEnumor str) – Identifier of the parameter to get- Returns:
The parameter as a
QtVariantif found, None otherwise
- 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
- getSubMeshColor(aEntityId, aSubMeshId)
Get the SubMeshColor corresponding to the given (entityId, subMeshId)
- Returns:
The
SubMeshColorobject if found, None otherwise
- getSubMeshColorHexa(aEntityId, aSubMeshId)
Get the hexadecimal color of the SubMeshColor corresponding to the given (entityId, subMeshId)
- Parameters:
aEntityId (int) – Index of the entity that contains the submesh (start to 1)
aSubMeshId (int) – Index of the submesh part (start to 0)
- 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
SubMeshSelectionobject if found, None otherwise
- isSubMeshSelected(aEntityId, aSubMeshId)
Check if the given (entityId, subMeshId) is selected
- Parameters:
aEntityId (int) – Index of the entity that contains the submesh (start to 1)
aSubMeshId (int) – Index of the submesh part (start to 0)
- Returns:
True if the given submesh index is selected, False otherwise
- moveDownBaker(aBaker)
Move down the given baker in the bakers list
- Parameters:
aBaker (
BakingConverterorBakerEnumor str) – Baker to move down in the bakers list- Raise:
SBSImpossibleActionError
- moveUpBaker(aBaker)
Move up the given baker in the bakers list
- Parameters:
aBaker (
BakingConverterorBakerEnumor str) – Baker to move up in the bakers list- Raise:
SBSImpossibleActionError
- removeBaker(aBaker)
Remove the given baker
- Parameters:
aBaker (
BakingConverterorBakerEnumor 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:
aBaker (
BakingConverterorBakerEnumor str) – Baker to select, as an object or an identifieraSelected (bool) – True to select the baker, False to deselect it
- Raise:
SBSImpossibleActionError
- 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
- 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:
aParameter (
ConverterParamEnumor str) – Identifier of the parameter to setaResource (
SBSResource) – The resource to reference
- Returns:
True if success, False otherwise
- Raise:
SBSImpossibleActionError
- setParameterValue(aParameter, aParamValue)
Set the value of the given global parameter
- Parameters:
aParameter (
BakingGlobalParam) – The parameter to setaParamValue (any type) – The value to set
- Raise:
SBSImpossibleActionError
- setSubMeshColorHexa(aEntityId, aSubMeshId, aColor)
Set the given color to the SubMesh part of the given Id
- Parameters:
aEntityId (int) – Index of the entity that contains the submesh (start to 1)
aSubMeshId (int) – Index of the submesh part (start to 0)
aColor (str) – The hexadecimal color
- Returns:
Nothing
- Raise:
SBSImpossibleActionError
- setSubMeshSelection(aEntityId, aSubMeshId, aSelected)
Set the given color to the SubMesh part of the given Id
- Parameters:
aEntityId (int) – Index of the entity that contains the submesh (start to 1)
aSubMeshId (int) – Index of the submesh part (start to 0)
aSelected (bool) – True to select the SubMesh part, False to deselect it
- 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
SBSOptionsobject with the content of the BakingParameters