1. Load the ViewModel
Obtain a ViewModel from a.riv
file:
GetInstanceNames()
.
2. Create a ViewModel Instance
Create an instance of the ViewModel to hold runtime property values:3. Bind the Instance to an Artboard
Bind the ViewModel instance to aURiveArtboard
to establish data context:
FRiveStateMachine
, ensuring synchronized behavior. Likewise, setting the ViewModel instance on a state machine sets it on the state machineโs artboard.These operations can also be performed using Blueprints:\

4. Access or Modify Properties via the ViewModel Instance
URiveViewModelInstance
exposes strongly-typed helper accessors to change and read values without needing to access the underlying porperties:
โ Boolean
๐ข Number
๐ String
๐จ Color
๐งฉ Enum
๐ Trigger
๐ฆ Nested ViewModels

5. ๐งช Using Accessors on Property Objects
EachURiveViewModelInstanceValue
subclass exposes GetValue()
and SetValue()
(or equivalents), enabling direct manipulation. This is especially useful if you want to cache a property for later use.
โ Boolean
๐ข Number
๐ String
๐จ Color
๐งฉ Enum
๐ Trigger

5. Respond to Property Changes
Each property value subclass (e.g.URiveViewModelInstanceString
) supports change detection.
