UsdzWriter class final

Encodes a ModelDocument as .usdz — fmt-27's own row, and a spike rather than the feature-complete writer every other format here has: geometry only, no materials, no hierarchy past one Mesh prim per surface. What decides whether it grows past that is stated in the plan as a question — is there demand — and a spike is exactly the size of thing that can answer it without committing to the rest up front.

One Mesh prim per surface, each with its own transform baked in. USD has real hierarchy and this writer does not use any of it, for the same reason StlWriter (../stl/stl_writer.dart) does not: every surface's placement is its own affair here, and a document with more than one surface reads as a flat set of siblings under one root rather than the tree it may have had on the way in.

Every string is ASCII and every number a fixed six decimal places. A .usda file is text a person can open, but nothing here is meant to be hand-edited — the fixed formatting is what makes two writes of the same document byte-identical, the same determinism GltfWriter holds itself to and for the same reason: a diff that is all whitespace noise hides the diff that matters.

Constructors

UsdzWriter(ModelDocument document, {String name = 'model'})

Properties

document → ModelDocument
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The .usda entry's own name inside the archive, and the root Xform prim's name once sanitized to a legal USD identifier.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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
Builds the archive: one .usda layer, first — the entry a .usdz reader treats as the default is whichever comes first, which is why nothing else is ever stored ahead of it.

Operators

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