ifcopenshell.api.style.add_surface_textures

Module Contents

class ifcopenshell.api.style.add_surface_textures.Usecase
apply_uv_map_to_texture(texture)
create_surface_texture(node, mode)
detect_diffuse_map(bsdf)
detect_emissive_map(bsdf)
detect_metallicroughness_map(bsdf)
detect_normal_map(bsdf)
detect_occlusion_map()
detect_unlit_emissive_map(bsdf)
execute()
process_texture_coordinates(node, texture)
ifcopenshell.api.style.add_surface_textures.add_surface_textures(file: ifcopenshell.file, material: bpy.types.Material | None = None, textures: list[dict] | None = None, uv_maps: list[ifcopenshell.entity_instance] | None = None) list[ifcopenshell.entity_instance]

Add surface texture based on a Blender material definition or texture data.

Either material or textures should be provided.

Parameters:
  • material (bpy.types.Material, optional) – The Blender material definition with a node tree that is compatible with glTF. See one of the valid combinations here: https://docs.blender.org/manual/en/dev/addons/import_export/scene_gltf2.html

  • uv_maps (list[ifcopenshell.entity_instance]) – A list of IfcIndexedTextureMap for any IfcTessellatedFaceSets that the representation has, obtained from the HasTextures attribute.

  • textures (list[dict], optional) –

    A list of dictionaries containing:

    1. Attributes to create IfcImageTexture.

    2. One additional parameter uv_mode to map IfcImageTexture to correct IfcTextureCoordinate type.

    Possible uv_mode values:

    • UV - use IfcTextureCoordinate from uv_maps parameter;

    • Generated - IfcTextureCoordinateGenerator with mode COORD (autogenerated UV based on geometry);

    • Camera - IfcTextureCoordinateGenerator with mode COORD_EYE (autogenerated UV based on camera position)

Returns:

A list of IfcImageTexture

Return type:

list[ifcopenshell.entity_instance]