trimesh.schemas module

schemas.py

Tools for dealing with schemas, particularly JSONschema

Functions

resolve_json(text, resolver[, recursive, …])

Given a JSON Schema containing $ref keys, replace all referenced URI values with their values using trimesh Resolver objects.

trimesh.schemas.resolve_json(text, resolver, recursive=True, fill_empty='{}')

Given a JSON Schema containing $ref keys, replace all referenced URI values with their values using trimesh Resolver objects.

Parameters
  • text (str) – JSON text including $ref to other files

  • resolver (trimesh.visual.resolver.Resolver) – Resolver to fetch referenced assets

  • recursive (bool) – If True, resolve references in referenced files

  • fill_empty (str) – What to replace empty references with

Returns

result – JSON text with references filled in

Return type

str