Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this package. Versions follow [Semantic Versioning](https

## Unreleased

### Data validation

- Validate prefab hierarchy documents against their published transform and component schema.
- Describe room, spot, sound, video and CRI Lips documents, and accept null localization on native text records.

### Site products

- Load live variants from entry manifests and accept variant paths in read-set requests.
Expand Down Expand Up @@ -179,4 +184,3 @@ All notable changes to this package. Versions follow [Semantic Versioning](https
- install from GitHub until the package is on npm
- add performance.md: the CPU cost of a frame
- a file holds each controller and clip once; the validator checks every reference _(story)_

11 changes: 11 additions & 0 deletions docs/data-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ Rules:

### Objects

Prefab object documents have a [JSON Schema](../schema/prefab.schema.json) for hierarchy nodes, transforms,
components and RectTransform fields. Data validation also checks that parents precede their children.

Several products may retain different file roles of the same object. Loading their manifests combines these
roles; overlapping roles and object metadata must agree. Product paths may include region directories, and are
relative to the layout root.
Expand Down Expand Up @@ -988,3 +991,11 @@ The song catalog example reads `music-data.json` with format `nnnotes.music-data
A chart entry under `charts/` can be an `nnnotes.product/1` live manifest. Its optional `variants` lists immutable note-skin, note-effect and sound products relative to its declared root; the loader combines them with the required parts. `options.LiveQuality` lists the offered qualities. `scripts/read-set.mjs --variants=<JSON array>` supplies extra manifest paths for either plan or full mode.

The live's `parts.ui` maps languages to UI products. An `audio: false` entry omits sound streams while retaining cue metadata. Story sessions use silent timing for such entries. Story listings select a playback language for which the entry includes resources.

### Scene and media document schemas

- [room](../schema/room.schema.json)
- [spot](../schema/spot.schema.json)
- [story-video](../schema/story-video.schema.json)
- [story-sound](../schema/story-sound.schema.json)
- [crilips](../schema/crilips.schema.json)
57 changes: 57 additions & 0 deletions schema/crilips.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"$id": "https://raw.githubusercontent.com/empty-sekai/ournotes-player/main/schema/crilips.schema.json",
"title": "crilips document",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"dtype",
"order",
"total_floats",
"blocks",
"constants",
"frontend"
],
"properties": {
"dtype": {
"const": "float32"
},
"order": {
"const": "LE"
},
"total_floats": {
"type": "integer",
"minimum": 0
},
"blocks": {
"type": "array",
"items": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"name",
"offset",
"count"
],
"properties": {
"name": {
"type": "string"
},
"offset": {
"type": "integer",
"minimum": 0
},
"count": {
"type": "integer",
"minimum": 0
}
}
}
},
"constants": {
"type": "object"
},
"frontend": {
"type": "object"
}
}
}
174 changes: 174 additions & 0 deletions schema/prefab.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
{
"$id": "https://raw.githubusercontent.com/empty-sekai/ournotes-player/main/schema/prefab.schema.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"nodes"
],
"properties": {
"name": {
"type": "string"
},
"scene": {
"type": "string"
},
"nodes": {
"type": "array",
"items": {
"$ref": "#/$defs/node"
}
}
},
"$defs": {
"vec2": {
"type": "object",
"required": [
"x",
"y"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
}
}
},
"vec3": {
"type": "object",
"required": [
"x",
"y",
"z"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
}
},
"quat": {
"type": "object",
"required": [
"x",
"y",
"z",
"w"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
},
"w": {
"type": "number"
}
}
},
"component": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"minLength": 1
},
"pathId": {
"type": "string",
"pattern": "^-?[0-9]+$"
},
"script": {
"type": [
"string",
"null"
]
},
"fields": {
"type": "object"
}
}
},
"node": {
"type": "object",
"required": [
"path",
"localPosition",
"localRotation",
"localScale",
"components"
],
"properties": {
"path": {
"type": "string"
},
"name": {
"type": "string"
},
"pathId": {
"type": "string",
"pattern": "^-?[0-9]+$"
},
"transformPathId": {
"type": "string",
"pattern": "^-?[0-9]+$"
},
"active": {
"type": "boolean"
},
"layer": {
"type": "integer"
},
"localPosition": {
"$ref": "#/$defs/vec3"
},
"localRotation": {
"$ref": "#/$defs/quat"
},
"localScale": {
"$ref": "#/$defs/vec3"
},
"components": {
"type": "array",
"items": {
"$ref": "#/$defs/component"
}
},
"rect": {
"type": "object",
"properties": {
"m_AnchorMin": {
"$ref": "#/$defs/vec2"
},
"m_AnchorMax": {
"$ref": "#/$defs/vec2"
},
"m_AnchoredPosition": {
"$ref": "#/$defs/vec2"
},
"m_SizeDelta": {
"$ref": "#/$defs/vec2"
},
"m_Pivot": {
"$ref": "#/$defs/vec2"
}
}
}
}
}
},
"title": "Prefab hierarchy"
}
81 changes: 81 additions & 0 deletions schema/room.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"$id": "https://raw.githubusercontent.com/empty-sekai/ournotes-player/main/schema/room.schema.json",
"title": "room document",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"backgroundKey",
"glb",
"meshCount",
"inactiveMeshes",
"nodes",
"materialIds",
"materials",
"textures",
"samplers"
],
"properties": {
"backgroundKey": {
"type": "string"
},
"glb": {
"type": "string"
},
"meshCount": {
"type": "integer",
"minimum": 0
},
"inactiveMeshes": {
"type": "integer",
"minimum": 0
},
"nullMaterialSubmeshes": {
"type": "array",
"items": {
"type": "object"
}
},
"nullMeshFilters": {
"type": "array",
"items": {
"type": "string"
}
},
"emptyMeshes": {
"type": "array",
"items": {
"type": "object"
}
},
"nodes": {
"type": "array",
"items": {
"type": "object"
}
},
"materialIds": {
"type": "array",
"items": {
"type": "string"
}
},
"materials": {
"type": "array",
"items": {
"type": "object"
}
},
"textures": {
"type": "array",
"items": {
"type": "string"
}
},
"samplers": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
Loading
Loading