sbsscenedata module

Module sbsscenedata provides the definition of the SubMeshColor and SubMeshSelection objects.

class pysbs.sbsbakers.sbsscenedata.SubMeshColor(aEntityId=1, aSubMeshId=0, aColor='#ff0000')

Bases: object

Class that describe the color associated to a Scene object entity

Members:
  • mEntityId (int): entity index

  • mSubMeshId (int): sub mesh index

  • mColor (str): the hexadecimal color

fromSBSTree(aIndexColor, aSBSTree, removeUsedOptions=False)

Get the content of the given SBSTree to set the SubMeshColor with the given id

Parameters:
  • aIndexColor (int) – Index of this submesh color in the options

  • aSBSTree (SBSTree) – The options tree to parse to build the Baking Converter

  • removeUsedOptions (bool, optional) – True to allow removing the options used to build this SubMeshColor from the given list. Default to False

Returns:

True if success, False otherwise

getColorHexa()

Get the hexadecimal color of this SubMeshColor

Returns:

The hexadecimal color as a string if it exists, None otherwise

setColorHexa(aColor)

Set the given hexadecimal color

Parameters:

aColor (str) – The hexadecimal color

toSBSOptionList(aIndexColor)

Convert the SubMeshColor object into a list of SBSOptions, as it is saved in the .sbs file

Parameters:

aIndexColor (int) – Index of this color in the Baking Parameters

Returns:

A list of SBSOptions object with the content of the SubMeshColor

class pysbs.sbsbakers.sbsscenedata.SubMeshSelection(aEntityId=1, aSubMeshId=0)

Bases: object

Class that describe a Scene selection

Members:
  • mEntityId (int): entity index

  • mSubMeshId (int): sub mesh index

fromSBSTree(aColorIndex, aSBSTree, removeUsedOptions=False)

Get the content of the given SBSTree to set the SubMeshSelection with the given id

Parameters:
  • aIndexSelection (int) – Index of this submesh selection in the options

  • aSBSTree (SBSTree) – The options to parse to build the Baking Converter

  • removeUsedOptions (bool, optional) – True to allow removing the options used to build this SubMeshColor from the given list. Default to False

Returns:

True if success, False otherwise

toSBSOptionList(aIndexSelection)

Convert the SubMeshSelection object into a list of SBSOptions, as it is saved in the .sbs file

Parameters:

aIndexSelection (int) – Index of this selection in the Baking Parameters

Returns:

A list of SBSOptions object with the content of the SubMeshSelection