skppy.material_loader

Load standalone SketchUp material packages.

skppy.material_loader.load_material(filepath: str | PathLike[str], *, import_vray_materials: bool = False, limits: LoadLimits | None = None, cancellation_check: Callable[[], bool] | None = None) → Material[source]

Load one standalone SketchUp material package.

Package detection uses the ZIP contents rather than the filename suffix, so incorrectly named .skp downloads containing an SKM material are accepted as well as conventional .skm files.

Parameters:
  • filepath (str or os.PathLike) – Path to a SketchUp material ZIP containing document.xml.

  • import_vray_materials (bool, optional) – Prefer supported V-Ray and Enscape PBR values embedded in the material XML.

  • limits (LoadLimits, optional) – Uncompressed resource and cumulative read budgets, enforced before extraction.

  • cancellation_check (callable, optional) – Cooperative cancellation callback checked between read chunks.

Returns:

Material appearance, renderer parameters, and embedded textures.

Return type:

Material

Raises:

InvalidSkmError – If the file is not a supported material package.