trimesh.visual.resolvers module

resolvers.py

Tools to load assets referenced in meshes, like MTL files or texture images.

Classes

FilePathResolver(source)

Resolve files from a source path on the file system.

Resolver(*args, **kwargs)

WebResolver(url)

Resolve assets from a remote URL.

ZipResolver(archive)

Resolve files inside a ZIP archive.

class trimesh.visual.resolvers.FilePathResolver(source)

Bases: trimesh.visual.resolvers.Resolver

Resolve files from a source path on the file system.

Methods

get(name)

Get an asset.

get(name)

Get an asset.

Parameters

name (str) – Name of the asset

Returns

data – Loaded data from asset

Return type

bytes

class trimesh.visual.resolvers.Resolver(*args, **kwargs)

Bases: object

class trimesh.visual.resolvers.WebResolver(url)

Bases: trimesh.visual.resolvers.Resolver

Resolve assets from a remote URL.

Methods

get(name)

Get a resource from the remote site.

get(name)

Get a resource from the remote site.

Parameters

name (str) – Asset name, i.e. ‘quadknot.obj.mtl’

class trimesh.visual.resolvers.ZipResolver(archive)

Bases: trimesh.visual.resolvers.Resolver

Resolve files inside a ZIP archive.

Methods

get(name)

Get an asset from the ZIP archive.

get(name)

Get an asset from the ZIP archive.

Parameters

name (str) – Name of the asset

Returns

data – Loaded data from asset

Return type

bytes