From 5c3349dd28f3309223f92c89eafb4818dba735a5 Mon Sep 17 00:00:00 2001 From: luzieahrens Date: Thu, 2 Jul 2026 10:19:51 +0200 Subject: [PATCH] update glow --- data-structure-block-coding.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/data-structure-block-coding.md b/data-structure-block-coding.md index bc9509f..c285879 100644 --- a/data-structure-block-coding.md +++ b/data-structure-block-coding.md @@ -57,12 +57,14 @@ A script's head block can be one of two kinds: |---|---|---| | `kind` | `"scene"` | Discriminant identifying this as a scene-event trigger | | `id` | `string` | Unique block identifier | -| `event` | `"clicked" \| "proximity_enter" \| "proximity_exit"` | The interaction event to watch for | +| `event` | `"clicked" \| "proximity_enter" \| "proximity_exit" \| "looked_at"` | The interaction event to watch for | | `sourceItemId` | `number \| null` | Scene item ID to watch (`null` = no item selected yet) | | `radius` | `number` | Proximity enter radius in metres (only used when `event` is `"proximity_enter"`) | | `exitRadius` | `number` | Proximity exit radius in metres (only used when `event` is `"proximity_exit"`) | | `cooldown` | `number` | Minimum milliseconds between consecutive firings | +`"looked_at"` fires when a visitor looks directly at `sourceItemId` — it reuses `sourceItemId`/`cooldown` like `"clicked"` and does not use `radius`/`exitRadius`. Effect blocks in a script headed by a `"looked_at"` trigger never show Toggle mode (see `EffectBlock.toggle` below). + --- ## `SourceBlock` @@ -110,6 +112,8 @@ All fields are always present regardless of `effectProp`. Fields that are irrele "targetRotationValue": 0, "targetScale": 1, "targetVisibility": true, + "targetGlowColor": "#ffffff", + "targetGlowIntensity": 1, "toggle": true } ``` @@ -117,7 +121,7 @@ All fields are always present regardless of `effectProp`. Fields that are irrele | Field | Type | Description | |---|---|---| | `id` | `string` | Unique block identifier | -| `effectProp` | `"color" \| "position" \| "rotation" \| "scale" \| "visibility"` | Which property this block modifies | +| `effectProp` | `"color" \| "position" \| "rotation" \| "scale" \| "visibility" \| "glow"` | Which property this block modifies | | `targetObjectType` | `"item" \| "sky"` | Whether to target a scene item or the sky color | | `targetItemId` | `number \| null` | Scene item ID (only relevant when `targetObjectType` is `"item"`) | | `targetColor` | `string` | Target hex color (used when `effectProp` is `"color"`) | @@ -127,9 +131,11 @@ All fields are always present regardless of `effectProp`. Fields that are irrele | `targetRotationValue` | `number` | Target rotation angle in degrees | | `targetScale` | `number` | Uniform scale multiplier (used when `effectProp` is `"scale"`) | | `targetVisibility` | `boolean` | `true` = visible, `false` = hidden (used when `effectProp` is `"visibility"`) | -| `toggle` | `boolean` | When `true`, each firing alternates between current state and target value instead of always applying the target. Not available for `"visibility"`, and not shown/used when the parent script's `trigger.kind` is `"source"` with `mode: "value"` | +| `targetGlowColor` | `string` | Target glow hex color (used when `effectProp` is `"glow"`). Always a static value — never source-bound, similar to `positionAxis`/`rotationAxis` | +| `targetGlowIntensity` | `number` | Glow intensity multiplier (used when `effectProp` is `"glow"`). This is the field replaced by an incoming Source value | +| `toggle` | `boolean` | When `true`, each firing alternates between current state and target value instead of always applying the target. Not available for `"visibility"`; not shown/used when the parent script's `trigger.kind` is `"source"` with `mode: "value"`; and not shown when the parent script's `trigger.kind` is `"scene"` with `event: "looked_at"` | -`EffectBlock` has no field referencing a source — the binding is implicit via the parent script's head block. There is no per-effect opt-in; if a script's head is a `SourceBlock` in `"value"` mode, **every** effect in that script is driven by the incoming value. +`EffectBlock` has no field referencing a source — the binding is implicit via the parent script's head block. There is no per-effect opt-in; if a script's head is a `SourceBlock` in `"value"` mode, **every** effect in that script is driven by the incoming value. For multi-field effects (`position`, `rotation`, `glow`) only the single "value" field is replaced by the incoming value — the axis selector (`positionAxis`/`rotationAxis`) and the glow color (`targetGlowColor`) stay static/manually set. ### Incoming values (Source, mode `"value"`) @@ -142,6 +148,7 @@ The expected shape of the REST response value depends on `effectProp`: | `rotation` | Number, in degrees, e.g. `90` | | `scale` | Number, as a multiplier, e.g. `1.5` | | `visibility` | Boolean or `0`/`1`, e.g. `true`, `false`, `1`, `0` | +| `glow` | Number, as a glow intensity multiplier, e.g. `1.5` (applies to `targetGlowIntensity` only — `targetGlowColor` stays static) | This mapping is UI-only today (shown as a hint in the panel) — no runtime in `xrwise-viewer` currently polls `SourceBlock.url` or applies these values; see [Persistence notes](#persistence-notes).