ModelDecoder class abstract interface

A decoder for a format the engine does not ship.

The plugin boundary for reading, and it is one interface wide. The engine knows glTF, OBJ and its own container; anything else — a studio's internal format, a compressed variant, a format that has not been invented yet — arrives as one of these and needs no change to this package.

Consulted before the built-in decoders, so an application can also replace one: a project with its own glTF reader gets its own glTF reader.

Implementations must be sendable, and that is not a formality — see ModelLoadRequest.decoders for the isolate that makes it one.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

decode(Uint8List bytes, ModelLoadRequest request, AssetUriResolver resolveUri) → Future<ModelDocument>
Reads bytes into a document.
handles(String fileName, Uint8List bytes) → bool
Whether this decoder wants the file. fileName may be empty; bytes is the whole file, so a decoder with no useful suffix can sniff its magic.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited