blenderproc.python.loader.CCMaterialLoader module

Offering to load the materials provided at ambientCG.com.

class blenderproc.python.loader.CCMaterialLoader._CCMaterialLoader[source]

Bases: object

static create_material(new_mat, base_image_path, ambient_occlusion_image_path, metallic_image_path, roughness_image_path, alpha_image_path, normal_image_path, displacement_image_path)[source]

Create a material for the cctexture datatset, the combination used here is calibrated to this.

Parameters:
  • new_mat (Material) – The new material, which will get all the given textures

  • base_image_path (str) – The path to the color image

  • ambient_occlusion_image_path (str) – The path to the ambient occlusion image

  • metallic_image_path (str) – The path to the metallic image

  • roughness_image_path (str) – The path to the roughness image

  • alpha_image_path (str) – The path to the alpha image (when this was written there was no alpha image provided in the haven dataset)

  • normal_image_path (str) – The path to the normal image

  • displacement_image_path (str) – The path to the displacement image

blenderproc.python.loader.CCMaterialLoader.load_ccmaterials(folder_path='resources/cctextures', used_assets=None, preload=False, fill_used_empty_materials=False, add_custom_properties=None, use_all_materials=False, skip_transparent_materials=True)[source]

This method loads all textures obtained from https://ambientCG.com, use the script (scripts/download_cc_textures.py) to download all the textures to your pc.

All textures here support Physically based rendering (PBR), which makes the textures more realistic.

All materials will have the custom property “is_cc_texture”: True, which will make the selection later on easier.

Parameters:
  • folder_path (str) – The path to the downloaded cc0textures.

  • used_assets (Optional[list]) – A list of all asset names, you want to use. The asset-name must not be typed in completely, only the beginning the name starts with. By default, all assets will be loaded, specified by an empty list.

  • preload (bool) – If set true, only the material names are loaded and not the complete material.

  • fill_used_empty_materials (bool) – If set true, the preloaded materials, which are used are now loaded completely.

  • add_custom_properties (Optional[dict]) – A dictionary of materials and the respective properties.

  • use_all_materials (bool) – If this is false only a selection of probably useful textures is used. This excludes some see through texture and non tileable texture.

  • skip_transparent_materials (bool) – If set to true, all materials with transparent portions are skipped.

Return type:

List[Material]

Returns:

a list of all loaded materials, if preload is active these materials do not contain any textures yet and have to be filled before rendering (by calling this function again, no need to save the prior returned list)