ifcopenshell.api.style.add_surface_textures

Module Contents

class ifcopenshell.api.style.add_surface_textures.TextureDict

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

uv_mode: NotRequired[Literal['UV', 'Generated', 'Camera']]
class ifcopenshell.api.style.add_surface_textures.Usecase
apply_uv_map_to_texture(texture: ifcopenshell.entity_instance) → None
create_surface_texture(node: bpy.types.ShaderNodeTexImage, mode: Literal['DIFFUSE', 'EMISSIVE', 'METALLICROUGHNESS', 'NORMAL', 'OCCLUSION']) → None
detect_diffuse_map(bsdf: bpy.types.Node) → None
detect_emissive_map(bsdf: bpy.types.Node) → None
detect_metallicroughness_map(bsdf: bpy.types.Node) → None
detect_normal_map(bsdf: bpy.types.Node) → None
detect_occlusion_map(material: bpy.types.Material) → None
detect_unlit_emissive_map(bsdf: bpy.types.Node) → None
execute(material: bpy.types.Material | None, textures: list[TextureDict], uv_maps: list[ifcopenshell.entity_instance]) → list[ifcopenshell.entity_instance]
process_texture_coordinates(node: bpy.types.ShaderNodeTexImage, texture: ifcopenshell.entity_instance) → None
file: ifcopenshell.file
textures: list[ifcopenshell.entity_instance]
uv_maps: list[ifcopenshell.entity_instance]
ifcopenshell.api.style.add_surface_textures.add_surface_textures(file: ifcopenshell.file, material: bpy.types.Material | None = None, textures: list[TextureDict] | 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 – 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 – A list of IfcIndexedTextureMap for any IfcTessellatedFaceSets that the representation has, obtained from the HasTextures attribute.

  • textures –

    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