GlbWriter class final
Writes small glTF files for tests, so fixtures are generated, not checked-in binaries.
Add accessors, meshes, materials, nodes and images, then call toGlb
(one file) or toGltf (JSON with the buffer as a data: URI).
Constructors
Properties
Methods
-
addAnimation(
Map< String, dynamic> animation) → int -
Adds an animation (raw glTF JSON:
channels,samplers,name). -
addFloats(
List< double> values, String type, {bool withBounds = false}) → int -
Adds float data as an accessor of
type(VEC3, …). Positions getmin/maxwhenwithBounds. -
addImage(
Uint8List bytes, {String mimeType = 'image/png'}) → int -
Adds an embedded image of
mimeType. -
addInts(
List< int> values, String type, int componentType, {bool normalized = false, bool indices = false}) → int -
Adds integer data of
componentType(5121 ubyte, 5122 short, 5123 ushort, 5125 uint), optionallynormalized. -
addMaterial(
Map< String, dynamic> material) → int - Adds a material from raw glTF JSON.
-
addMesh(
List< Map< primitives, {String? name}) → intString, dynamic> > -
Adds a mesh of
primitives(raw glTF JSON). -
addNode(
Map< String, dynamic> node) → int - Adds a node (raw glTF JSON).
-
addSkin(
Map< String, dynamic> skin) → int -
Adds a skin (raw glTF JSON:
joints,inverseBindMatrices, …). -
addSparse(
int count, String type, List< int> indices, List<double> values) → int -
Adds an accessor of
countzeros whoseindicesare replaced byvalues(a sparse accessor with no bufferView). -
addTexture(
int image, {Map< String, dynamic> ? sampler}) → int -
Adds a texture of
image. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setScene(
List< int> roots) → void -
Sets the scene to
roots. -
toGlb(
) → Uint8List -
The model as one
.glb. -
toGltf(
{String? bufferUri}) → (String, Uint8List) -
The model as
.gltfJSON with its buffer inline as adata:URI, or asbufferUriwhen given (the caller serves those bytes). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited