blendify.colors package

Submodules

blendify.colors.base module

class blendify.colors.base.Colors[source]

Bases: ABC

An abstract container template for storing the object coloring information

property metadata: ColorsMetadata
class blendify.colors.base.ColorsMetadata(type, color, has_alpha, texture)[source]

Bases: NamedTuple

color: ndarray | Tuple[float, float, float] | None

Alias for field number 1

has_alpha: bool

Alias for field number 2

texture: Image | None

Alias for field number 3

type: type

Alias for field number 0

blendify.colors.common module

class blendify.colors.common.UniformColors(uniform_color: ndarray | Tuple[float, float, float] | Tuple[float, float, float, float])[source]

Bases: Colors

A container which stores a single uniform color for the whole object

property color: ndarray

Get current color

Returns:

current color

Return type:

np.ndarray

class blendify.colors.common.VertexColors(vertex_colors: ndarray)[source]

Bases: Colors

A container which stores a color information for each vertex of an object (vertex colors are interpolated over the faces)

property vertex_colors: ndarray

Get current colors

Returns:

current vertex colors

Return type:

np.ndarray

blendify.colors.texture module

class blendify.colors.texture.FacesUV(data: ndarray)[source]

Bases: UVMap

A container which stores a UV coordinate for every vertex in every triangle face In the form of (M,3,2) array (M faces, 3 vertices in each face, 2 UV coordinates for each vertex in triangle)

class blendify.colors.texture.FileTextureColors(texture_path: str, uv_map: UVMap)[source]

Bases: UVColors

A container which stores path to the texture file and the corresponding UV mapping

property blender_texture: Image

Get the current Blender texture created from the pixels array

Returns:

current Blender texture

Return type:

bpy.types.Image

class blendify.colors.texture.TextureColors(texture: ndarray, uv_map: UVMap)[source]

Bases: UVColors

A container which stores texture in form of pixels array and the corresponding UV mapping

property blender_texture: Image

Get the current Blender texture created from the pixels array

Returns:

current Blender texture

Return type:

bpy.types.Image

class blendify.colors.texture.UVColors(uv_map: UVMap)[source]

Bases: Colors

An abstract container for storing color information bound to UV coordinate space

property uv_map: UVMap

Get the stored UV map

Returns:

stored UV map

Return type:

UVMap

class blendify.colors.texture.UVMap(data: ndarray)[source]

Bases: ABC

An abstract container template for storing a UV coordinate map

property data: ndarray

Get the stored UV map data

Returns:

UV map data

Return type:

np.ndarray

class blendify.colors.texture.VertexUV(data: ndarray)[source]

Bases: UVMap

A container which stores a UV coordinate for every vertex In the form of (N,2) array (N vertices, 2 UV coordinates for each)

Module contents