blenderproc.python.loader.TextureLoader module

Loads a texture based on a path. This is not the same as a material!

class blenderproc.python.loader.TextureLoader._TextureLoader[source]

Bases: object

static load_and_create(image_paths, colorspace)[source]

Loads an image, creates an image texture and assigns an image to this texture per each provided path.

Parameters:
  • image_paths (list) – List of absolute paths to assets. Type: list.

  • colorspace (str) – Colorspace type of the assets. Type: string.

Return type:

List[Texture]

Returns:

Created textures. Type: list.

static resolve_paths(path)[source]

Resolves absolute paths to assets in the provided folder, or to an asset if an appropriate path is provided.

Parameters:

path (str) – Path to folder containing assets or path to an asset. Type: string.

Return type:

list

Returns:

List of absolute paths to assets. Type: list.

blenderproc.python.loader.TextureLoader.load_texture(path, colorspace='sRGB')[source]

Loads images and creates image textures.

Depending on the form of the provided path: 1. Loads an image, creates an image texture, and assigns the loaded image to the texture, when a path to an image is provided. 2. Load images and for each creates a texture, and assigns an image to this texture, if a path to a folder with images is provided.

NOTE: Same image file can be loaded once to avoid unnecessary overhead. If you really need the same image in different colorspaces, then have a copy per desired colorspace and load them in different instances of this Loader.

Parameters:
  • path (str) – The path to the folder with assets/to the asset.

  • colorspace (str) – Colorspace type to assign to loaded assets. Available: [‘Filmic Log’, ‘Linear’, ‘Linear ACES’, ‘Non-Color’, ‘Raw’, ‘sRGB’, ‘XYZ’].

Return type:

List[Texture]

Returns:

The list of created textures.