cPy.cPaint module#

class PPPObject[source]#

Bases: BaseClass

Paint Object
static dynamic_cast(pObject: BaseClass) PPPObject[source]#
An analogue of the dynamic_cast function from C++, it checks whether the object pObject is a PPPObject class or its descendant, and if so, returns the specified object, but of the PPPObject type.
Delete()[source]#
GetName() str[source]#
SetName(new_name: str)[source]#
GetVisible() bool[source]#
SetVisible(value: bool)[source]#
GetLocked() bool[source]#
SetLocked(value: bool)[source]#
class PaintRoom[source]#

Bases: object

Paint Room
static LoadMesh(file_name: str) bool[source]#
Load poly object for painting room from file
Returns:

True if success

Return type:

bool

static LoadColorTexture(file_name: str) bool[source]#
Load texture from file and put it to a new layer
Returns:

True if success

Return type:

bool

static ForceMapCPUQuadsToGPU()[source]#
Force UpdateDirtyQuadsGPU to remap all CPU quads to GPU
static ForceBlendGPUQuads()[source]#
Force blending of all GPU quads for all layers
static ExportMesh(filename: str, fromRetopoRoom: bool = False, transformToSelectedObjectSpace: bool = False) bool[source]#
Export mesh the object from the painting room to a file
Returns:

True if success

Return type:

bool

static PPPObjectsCount() int[source]#
Get the count of paint objects in scene
Returns:

the amount

Return type:

int

static GetPPPObject(idx: int) PPPObject[source]#
static GetUVSetsCount() int[source]#
static GetUVSetName(index: int) str[source]#
Get the name of a UV set by its index.
Parameters:

index (int) – Index of the UV set.

Returns:

The name of the UV set.

Return type:

str

static RenameUVSet(index: int, newName: str)[source]#
Rename an existing UV set.
Parameters:
  • index (int) – Index of the UV set.

  • newName (str) – New name.

static GetUVSetResolutionX(index: int) int[source]#
Get the current texture resolution X for the specified UV set.
Parameters:

index (int) – Index of the UV set.

Returns:

width.

Return type:

int

static GetUVSetResolutionY(index: int) int[source]#
Get the current texture resolution Y for the specified UV set.
Parameters:

index (int) – Index of the UV set.

Returns:

height.

Return type:

int

static ResizeUVSet(index: int, width: int, height: int) bool[source]#
Change the texture resolution of the UV set.
Parameters:
  • index (int) – Index of the UV set.

  • width (int) – New width.

  • height (int) – New height.

Returns:

True on success.

Return type:

bool

static CalculateUVSpace(index: int) float[source]#
Calculate the total UV space area occupied by polygons in this UV set.
Parameters:

index (int) – Index of the UV set.

Returns:

Area in UV coordinates.

Return type:

float

static GetUVSetFaceCount(index: int) int[source]#
Get the number of polygons (faces) belonging to the specified UV set.
Parameters:

index (int) – Index of the UV set.

Returns:

Number of polygons.

Return type:

int