Skip to main content

register

Function register 

Source
pub fn register(registry: &mut Mesh3DRegistry)
Expand description

Register OBJ + MTL decoders and encoders with a Mesh3DRegistry.

Two format ids land:

  • "obj" — extension .obj. Decoder produces a fully-populated Scene3D; encoder emits a single OBJ document and accepts a companion MTL via ObjEncoder::with_mtl_basename.
  • "mtl" — extension .mtl. Decoder produces a Scene3D with only the materials populated (no meshes / nodes); encoder emits the MTL document for the scene’s materials.

The OBJ encoder does not automatically write the companion MTL — that’s the caller’s job (since they own the file-system context). See mtl::serialize_mtl / obj::serialize_obj if you need to drive both halves manually.