Declare ViewModel types as Luau classes
Currently, ViewModel properties are described directly in the Rive editor. It would be very useful to have an additional script type that allows ViewModel types to be declared as Luau classes.
These script-defined ViewModels could appear in the editor as read-only type definitions, while still allowing instances of those ViewModels to be created and configured in the editor.
This would make ViewModels more powerful and reusable by allowing developers to:
define methods and helper functions alongside the data model
share ViewModel definitions across multiple files
keep type definitions in code while still exposing instances to designers in the editor
reduce duplication when working with the same ViewModel structure in different places
For example, instead of manually defining the same ViewModel properties in multiple files, a developer could define a Luau class once and reuse it wherever needed. The editor would treat the class as the source of truth for the ViewModel structure (appears as read-only in the editor), while instances could still be created and wired up visually.
This would be especially helpful for teams that want to combine editor-driven workflows with more structured, code-based ViewModel definitions. It might also help taking advantage of AI agent to maintain the view model types.