convert library

Conversion as a library: convertFiles takes the bytes of an upload or of an unpacked Unity, Godot or USD bundle and returns the engine's files — .f3d, .fmat, .f3dmat, level documents with prefabs — with a report of what mapped, what was approximated and what was dropped.

Plain Dart: no Flutter, and no external program. FBX, .blend and binary USD need one, and are reported as unsupported here; the flutter3d convert command line runs them when they are installed.

Classes

ConversionResult
What convertFiles made.
ConversionTarget
Which outputs a conversion hands back.
ConvertOutcome
How one input ended.
ConvertReport
One input's report.
ModelSettings
The model-side options, passed to every .f3d written.
TextureFamily
The compression family a texture should target — ap-09's own row.

Constants

convertReportFormat → const FormatSpec
The file flutter3d convert --report <file> writes, for a FormatRegistry: the envelope, then reports, one ConvertReport an input.
convertReportVersion → const int
The version of the document --report writes, and the newest convertReportsFrom reads.

Functions

convertFiles(Map<String, Uint8List> files, {required ConversionTarget to, String? entry, String assetPrefix = '', ModelSettings models = const ModelSettings(), bool materials = true, bool bundle = true}) → Future<ConversionResult>
Converts files — one upload, or every file of an unpacked Unity, Godot or USD bundle, by its path inside the bundle — and returns the outputs to asks for, with the reports.
convertReportDocument(Iterable<ConvertReport> reports) → Map<String, Object?>
reports as --report writes them.
convertReportsFrom(Object? json) → List<Map<String, Object?>>
The reports a --report file holds, each as ConvertReport.toJson wrote it: from the enveloped document, or from the bare list the file was before 1.0.
exitCodeFor(Iterable<ConvertOutcome> outcomes) → int
The exit code for a whole run: 0 when every input converted, otherwise the code of the most serious outcome — a failure (1) before a missing tool (3) before a refusal to overwrite (4).

Exceptions / Errors

SourceFormatException
A source file flutter3d convert could not read: a PLY, USD, Godot or Unity text file, an XML document or a ZIP archive that is damaged or not what it says, a face that names a point the mesh does not have, or a file no reader claims.