RAVDocsViewModel Controls
RAV
2.4.3 current public release. This documentation describes the version available from GitHub and the normal public updater feed.

ViewModel Controls

RAV automatically discovers ViewModel inputs from loaded animations and renders them as native controls in the right panel.

Properties panel showing ViewModel and state machine controls
1

ViewModel Section

Enum dropdowns, number inputs, boolean checkboxes, color picker with alpha slider, string and image inputs, plus collapsible nested VM instances — all auto-discovered from the loaded animation.

2

State Machine Section

Boolean, number, and trigger inputs discovered from the active state machine, synchronized with the running runtime.

Supported Input Types

TypeControlBehavior
BooleanCheckboxImmediately updates the runtime value
NumberText inputAccepts decimal values, updates on blur or Enter
StringText inputUpdates on blur or Enter
TriggerButtonFires the trigger once per click
EnumDropdownLists all enum values, selects immediately
ColorColor picker + alphaNative color input with alpha slider
ImageOne full-width source selectLists every embedded raster asset, then Open file… and Clear; the file input stays hidden and there are no separate action buttons

Nested ViewModels

When a ViewModel contains nested properties, RAV renders them as collapsible sections with depth-colored accent bars. The root starts expanded; nested sections start collapsed.

Dynamic Lists

ViewModel lists show every item that currently exists — there is no ten-row cap. RAV first uses a direct authored instance name when the runtime exposes one. If the Web wrapper exposes only the definition's viewModelName, RAV compares readable string properties with that definition's canonical instance-name set and accepts only one unique match. Ambiguous or missing matches fall back to Row 1,Row 2, and so on; the generic definition name is never presented as an authored row label. When animation logic changes the controlling count, the Properties panel rebuilds from the live list topology automatically.

Live validation confirmed that authored per-instance labels remain distinct and preserve runtime order across a dynamically populated multi-row list.

MCP paths use the runtime's zero-based index even though labels are one-based. For example, rows/0/playerName addresses Row 1. Call rav_get_vm_tree after the list resizes to discover its current bounds.

Live Sync

Controls continuously sync with the runtime. If a value changes from animation logic, the UI updates automatically. Active focused inputs are skipped during sync to avoid disrupting edits.

Value Persistence

When you reset or restart an animation, RAV captures all ViewModel and state machine values and restores them after reload. If list items materialize a few frames later, pending values are retried until their live paths exist. Triggers are excluded since they are one-shot actions.

ViewModel Labels

Section headers display the exact name from the Rive file, preserving original casing, dashes, and special characters.

Embedded Images

RAV captures raster bytes embedded in the loaded .rivwhile leaving the runtime's normal asset loading intact. Each image property gets one full-width select: every captured raster appears first, followed by Open file… andClear. Open file… invokes a hidden external file input. There is no separate folder button, separate clear button, or Embedded image…placeholder.

Catalog entries use the runtime asset's uniqueFilename identity, determine PNG, WebP, JPEG, or AVIF MIME from the bytes rather than trusting an extension, and add numbered labels when display names repeat. Live validation confirmed that every embedded raster is included while embedded fonts, scripts, and other non-raster resources remain outside the image catalog. Standalone exports rebuild the same catalog and control.

Selecting an image calls the loaded runtime's decoder; Clear writesnull. Decoded image objects are live runtime values and are not included in JSON snapshots or generated control-value payloads.