F3dWriter class final

Serializes any ModelDocument into the .f3d container.

Takes a ModelDocument rather than a glTF or an OBJ, which is the whole reason that abstraction exists: one converter serves every decoder the engine has, and a third format needs a decoder rather than a second writer.

Runs offline, in dart run flutter3d_build:convert (flutter3d_build). Nothing here is on a frame path, so it favours being obviously correct over being quick.

Constructors

F3dWriter(ModelDocument document, {List<F3dExtraSection> extraSections = const <F3dExtraSection>[], Map<String, String> programs = const <String, String>{}, Map<String, Map<String, Object?>> prefabs = const <String, Map<String, Object?>>{}, Map<String, Uint8List> files = const <String, Uint8List>{}, Map<String, Map<String, Object?>> physicalMaterials = const <String, Map<String, Object?>>{}})
F3dWriter.carrying(ModelDocument document)
A writer for document that carries everything a .f3d it was read from carried: its programs, prefabs, files, physical materials and every section of a kind the engine does not write itself, flags included. A document from any other reader carries nothing beyond the model.
factory

Properties

document → ModelDocument
final
extraSections → List<F3dExtraSection>
Sections written after the engine's own, as they are: a tool's data under a f3dVendorKindStart kind, or a section a newer engine reads.
final
files → Map<String, Uint8List>
Files to carry whole, by the path a prefab names them by — F3dSection.files.
final
hashCode → int
The hash code for this object.
no setterinherited
physicalMaterials → Map<String, Map<String, Object?>>
Physical materials to carry whole, by id, each the document flutter3d_matter writes for one (PhysicalMaterial.toJson) — F3dSection.physicalMaterials. For a material the catalog does not ship; a material's SurfaceMaterial.physicalMaterial names either. The constructor refuses a document whose id is not its key.
final
prefabs → Map<String, Map<String, Object?>>
Level and prefab documents to carry, by name, each a JSON object in the format envelope ("format": "f3d.level") — F3dSection.prefabs.
final
programs → Map<String, String>
Material language (.f3dmat) sources to carry, by the name a material's lighting model names them by — F3dSection.programs.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
warnings → List<String>
What write could not carry — fmt-12's own row.
latefinal

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
write() → Uint8List
Encodes the document. The result is a complete file.

Operators

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