.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
| Attribute | Value |
|---|---|
name | Identifier used to look up the prim and reference it from other attributes |
xform | Translation, rotation, and scale |
material | Standard PBR (physically based rendering) material |
shader | Path to an .hss shader graph, used instead of material |
image | Image file path and texture sampling parameters |
collider | Physics collider shape |
rigid_body | Rigid-body simulation mode |
gravity_scale | Multiplier for gravity acting on the prim |
script | Path to a script crate's Cargo.toml |
reference | Path to another .hsda file embedded as a separate document |
spawn | Spawn 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:
(
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>