User Guide Cancel

qtclasses | Substance 3D Automation ToolKit

qtclasses

Content included in qtclasses module:

Module qtclasses provides an implementation of a very small subset of classes present in PyQt API, in particular the QVariant object, in order to handle the objects serialized in the .sbs file from a Qt object, as it is the case for the Baking Parameters.

class qtclasses.qtclasses.QtVariantTypeEnum
class qtclasses.qtclasses.QtVariantTypeEnum
class qtclasses.qtclasses.QtVariantTypeEnum
NONE = 0
BOOL = 1
INT = 2
DOUBLE = 6
VARIANT_MAP = 8
VARIANT_LIST = 9
STRING = 10
STRING_LIST = 11
BYTE_ARRAY = 12
URL = 17
SIZE = 21
NONE = 0 BOOL = 1 INT = 2 DOUBLE = 6 VARIANT_MAP = 8 VARIANT_LIST = 9 STRING = 10 STRING_LIST = 11 BYTE_ARRAY = 12 URL = 17 SIZE = 21
NONE            = 0 
BOOL            = 1 
INT             = 2 
DOUBLE          = 6 
VARIANT_MAP     = 8 
VARIANT_LIST    = 9 
STRING          = 10 
STRING_LIST     = 11 
BYTE_ARRAY      = 12 
URL             = 17 
SIZE            = 21
class qtclasses.qtclasses.QtVariant(aType=None, aValue=None)
class qtclasses.qtclasses.QtVariant(aType=None, aValue=None)
class qtclasses.qtclasses.QtVariant(aType=None, aValue=None)

Bases: object

Class QtVariant provides the definition of a variant object.

Members
getValue()
getValue()
getValue()

Get the value of the variant object

Returns: The value of the variant object
getValueStr()
getValueStr()
getValueStr()

Get the value of the variant object converted into a string

Returns: The value of the variant object, as a string
setValue(aValue)
setValue(aValue)
setValue(aValue)

Set the value of the variant object, without modifying its type.

Parameters: aValue (any type compatible with the current type of the variant object) – The value to set
Raise: TypeError if the type of the value is incompatible with the type of the variant object
class qtclasses.qtclasses.QtVariantMap(aMap)
class qtclasses.qtclasses.QtVariantMap(aMap)
class qtclasses.qtclasses.QtVariantMap(aMap)

Bases: object

Class QtVariantMap provides the definition of a variant map, which has a dictionary associating a key to a QtVariant.

Members
  • mMap (dictionary with the format {key(str):value(QtVariant)}: the dictionary of variant objects.
getItem(aKey)
getItem(aKey)
getItem(aKey)

Get the variant object of the given key in the map

Parameters: aKey (str) – The key to look for
Returns: The variant object with this key if found, None otherwise
getItemValue(aKey)
getItemValue(aKey)
getItemValue(aKey)

Get the value of the given key in the map

Parameters: aKey (str) – The key to look for
Returns: The value of the variant object with this key if found, None otherwise
getSize()
getSize()
getSize()

Get the size of the map

Returns: The size of the map as an integer
setItem(aKey, aValue)
setItem(aKey, aValue)
setItem(aKey, aValue)

Set the given item with the given key

Parameters:
  • aKey (str) – The key to add
  • aValue (QtVariant) – The item to set
Returns:

The size of the map as an integer

pop(aKey, aDefault)
pop(aKey, aDefault)
pop(aKey, aDefault)

Remove the item at the given key and return it.

Parameters:
  • aKey (str) – The key to remove
  • aDefault (any type) – The default value to return if not found
Returns:

The item removed if found, of the given default value if not found

class qtclasses.qtclasses.QtColor(aMode=1, aAlpha=0, aC1=0, aC2=0, aC3=0, aC4=0)
class qtclasses.qtclasses.QtColor(aMode=1, aAlpha=0, aC1=0, aC2=0, aC3=0, aC4=0)
class qtclasses.qtclasses.QtColor(aMode=1, aAlpha=0, aC1=0, aC2=0, aC3=0, aC4=0)

Bases: object

Class QtColor provides the definition of a color.

Members
  • mMode (QtColorModeEnum)}: the color mode.
  • mAlpha (int): Alpha component value
  • mC1 (int): First component value
  • mC2 (int): Second component value
  • mC3 (int): Third component value
  • mC4 (int): Fourth component value
class QtColorModeEnum
class QtColorModeEnum
class QtColorModeEnum

Bases: object

Color mode enumeration

NONE = 0
ARGB = 1
AHSV = 2
ACMYK = 3
AHSL = 4
NONE = 0 ARGB = 1 AHSV = 2 ACMYK = 3 AHSL = 4
NONE  = 0 
ARGB  = 1 
AHSV  = 2 
ACMYK = 3 
AHSL  = 4
getColor()
getColor()
getColor()

Get the color in the appropriate format depending on the color mode (RGB or HSV)

Returns: The color as a list of 4 int [R,G,B,A] or [H,S,V,A]
isRGBA()
isRGBA()
isRGBA()

Check if the color is defined as an RGBA color

Returns: True if RGBA, False otherwise
isHSVA()
isHSVA()
isHSVA()

Check if the color is defined as an HSVA color

Returns: True if HSVA, False otherwise
setColorRGBA(aColorRGBA)
setColorRGBA(aColorRGBA)
setColorRGBA(aColorRGBA)

Set the RGBA color with the provided values. R, G, B, and A component must be in the range [0;255]

Parameters: aColorRGBA (list of 4 int in the range [0;255]) – The RGBA color to set
Returns: nothing
setColorHSVA(aColorHSVA)
setColorHSVA(aColorHSVA)
setColorHSVA(aColorHSVA)

Set the HSV and Alpha color with the provided values. H component must be in the range [0;359] S, V, and A component must be in the range [0;255]

Parameters: aColorHSVA (list of 4 int. H in the range [0;359], S, V and A in the range [0;255]) – The HSVA color to set
Returns: nothing

Get help faster and easier

New user?