Expand description
frdt reads and edits Resonite .brson (FrDT) documents without turning
them into JSON.
Editing keeps one decompressed BSON buffer and an index of slot offsets;
summarize walks the Brotli stream once and keeps only counts and
extracted dynamic variables. Unknown components and fields are copied as
bytes, and non-finite doubles stay IEEE-754 values.
- Read:
Document::open,SlotHandle::children,SlotHandle::components,SlotHandle::component_value. - Edit in one document:
Document::add_slot,Document::add_component,SlotHandle::set,SlotHandle::set_component_value,Document::move_slot,Document::remove_slot. - Combine documents:
Document::emptybuilds an empty tree, andDocument::importcopies slot subtrees into it, renumbering every id and taking only the assets the copies use.Document::rebuild_typestrimsTypesto what remains. - Prepare for writing:
Document::renumber_idsgives every id a value that depends only on a seed and the document, so the same input writes the same bytes.Document::set_version_numberandDocument::set_feature_flagsreplace the root fields. - Check:
comparelists structural differences between two documents. - Cut out:
Document::extractmakes a slot subtree a document of its own, with that slot as the root. - Write:
Document::write_brson.
Structs§
- Asset
Info - One entry of the root
Assetarray. - Component
Info Typeindex, resolved name, and reference targets of one component.- Copied
Component - What
Document::copy_componentadded. - Copied
Components - What
Document::copy_componentsadded. - Difference
- One entry that differs.
leftis from the first document,rightfrom the second;Nonemeans the entry is missing on that side. - Document
- An open FrDT document. Mutations update this buffer in place.
- Dynamic
Variable - A dynamic variable component, or a dynamic variable space.
- Extract
- The result of
Document::extract. - Float3
- Three IEEE-754 doubles, stored as a BSON document
{x, y, z}. - FloatQ
- Four IEEE-754 doubles, stored as a BSON document
{x, y, z, w}. - Import
- What
Document::importcopied. - Import
Options - Options of
Document::import_with. The default is whatDocument::importdoes. - Slot
Handle - A slot inside a
Document. - Summary
- Counts and dynamic variables from a single pass.
Enums§
- DynKind
- DynValue
- A scalar or small aggregate read from a Dynamic Variable field.
- Error
- Errors from opening, walking, or editing an FrDT document.
- Mismatch
- One root field on which the destination and an imported source disagree.
- Unresolved
Policy - What an import does with a reference from the copy to a source id that was not copied. Within one document such an id is still there, so nothing is unresolved.
- Value
- A slot field value that can be written without going through JSON.
- Version
Policy - How an import treats
VersionNumber,FeatureFlags, andTypeVersionsthat differ from the destination’s.
Functions§
- compare
- Compare two documents by structure: slot tree, names, field values,
component types and fields, and what each reference points at. Ids
themselves do not take part, so a renumbered copy compares equal. Root
VersionNumber,FeatureFlags, andTypeVersions, and the content of referenced assets, are compared too. SeeDifference. - compare_
versions - Compare two
VersionNumberstrings part by part as numbers (2026.9.18.82>2026.9.8.100). A missing part counts as0. A part that is not a number sorts after every number, and two such parts compare as text. - float3
- Build a
float3slot value such asScale. - floatq
- Build a quaternion slot value such as
Rotation. - summarize
- Stream a
.brsonfile and keep only counts, type names, and dynamic variables. - version_
date - The leading
year.month.dayof aVersionNumbersuch as2026.9.18.82.