UNAVI Docs unavi.xyz
Build · Formats

.hsda: source

An .hsda file is the human-readable source format for an HSD (Hyper-Space Document). Files are written in RON (Rusty Object Notation) and compiled into binary .hsdz packages.

The schema is not version-locked and may change between releases.

Structure

An .hsda file contains a top-level prims list along with optional document metadata (meta). Each prim defines an attributes struct and a children list of nested prims.

A minimal object is a single prim with an attached script:

(
    prims: [
        (
            attributes: (
                name: "spawner",
                script: "./Cargo.toml",
            ),
            children: [],
        ),
    ],
)

Attributes

AttributeValue
nameIdentifier used to look up the prim and reference it from other attributes
xformTranslation, rotation, and scale
materialStandard PBR (physically based rendering) material
shaderPath to an .hss shader graph, used instead of material
imageImage file path and texture sampling parameters
colliderPhysics collider shape
rigid_bodyRigid-body simulation mode
gravity_scaleMultiplier for gravity acting on the prim
scriptPath to a script crate's Cargo.toml
referencePath to another .hsda file embedded as a separate document
spawnSpawn region radius where peers arrive in a space

Texture fields on a material reference another prim by its name attribute. The default home space combines document metadata, a referenced gate with a custom attribute, a script, and a spawn region:

(
    meta: (
        name: "Default Home",
        public: true,
    ),
    prims: [
        (
            attributes: (
                custom: {
                    "edit/locked": [
                        1,
                    ],
                },
                name: "gate",
                reference: "../unavi-gate/asset.hsda",
                xform: (
                    translation: [
                        0.0,
                        0.0,
                        -10.0,
                    ],
                ),
            ),
            children: [],
        ),
        (
            attributes: (
                name: "unavi-default-home",
                script: "./Cargo.toml",
            ),
            children: [],
        ),
        (
            attributes: (
                name: "spawn",
                spawn: (
                    radius: 4.0,
                ),
                xform: (
                    translation: [
                        0.0,
                        0.5,
                        0.0,
                    ],
                ),
            ),
            children: [],
        ),
    ],
)

Children

The children list nests prims under a parent transform. For example, unavi-gate defines two named child prims as attachment points for its script:

asset.hsdahsd/unavi-gate
(
    prims: [
        (
            attributes: (
                name: "gate",
                script: "./Cargo.toml",
            ),
            children: [
                (
                    attributes: (
                        name: "portal",
                        xform: (
                            translation: [
                                0.0,
                                1.3090171,
                                0.0,
                            ],
                        ),
                    ),
                    children: [],
                ),
                (
                    attributes: (
                        name: "socket",
                        xform: (
                            translation: [
                                -1.319017,
                                0.9975,
                                0.14,
                            ],
                        ),
                    ),
                    children: [],
                ),
            ],
        ),
    ],
)

Formatting

Format an .hsda file in place using the hsd CLI from the unavi workspace:

hsd format <file.hsda>