Rive CLI 1.3.0
This release brings your Rive account into the terminal. rive ls lists your projects, folders and files with their ids, and rive open <fileId> opens one in the editor. Before, the only place to find a file id for rive create --from-remote-file was the editor. Scroll views in the viewer now follow the mouse wheel and trackpad instead of only a drag, and state machine inputs inside a folder now make it into the .riv instead of being dropped without a warning. Update with rive update (curl install) or brew upgrade --cask rive-cli.
Your Rive account
๐๏ธ rive ls lists the projects in your current Workspace, then one folder level of a project, with the id of every row. rive ls <projectId> --all lists every file in a project with its folder path. On an interactive terminal it opens a browser instead: arrows move, enter opens a project or folder, and a file offers to open it in the editor, create a local project from it, or print its id. --plain prints the table and --json prints one object per line. Windows prints the table for now.
๐ข rive workspace shows your current Workspace and the others you belong to, and rive workspace <id> switches to one. rive whoami now names the current Workspace on a second line.
๐ rive open <fileId> opens the file in the web editor. --print prints the URL only.
๐งน rive uninstall --unused removes every cached CLI version except the one in use and the default. Before, each rive update or rive switch left the old version in ~/.rive/versions, and you removed them one rive uninstall <version> at a time.
Viewer
๐ฑ๏ธ Scroll views (ScrollConstraint) now scroll with a mouse wheel or trackpad, including a horizontal strip nested inside a vertical list. Before, they only scrolled with a pointer drag. wheelInteractive="false" turns it off for one scroll view. rive samples has a new scroll_demo to try it.
โจ๏ธ On macOS, Shift, Control, Option and Command pressed on their own now reach scripts and keyboard listeners. Before, a game that used Shift to boost did nothing in the viewer. On every platform, keys held down when the window loses focus are now released, so a key no longer stays pressed after you switch windows.
๐ฏ A headless --key with nothing before it now reaches the element the entry state focuses. Before, --key=down without an --advance first went nowhere and logged:
key: nothing is focused, so no listener will see thisScripting
๐ค Fonts and text from Rive Editor 0.9.46 work in CLI scripts too: get a font with context:font(name), lay out styled runs, and draw them with text:draw(renderer). Four new samples show it: scripted_text, text_island, text_string (a paragraph threaded on a rope you can drag apart) and text_rain. See the demos in action.
๐จ context:gpuTarget() returns the target Rive draws into, so a script's GPU pass can draw straight into it, under all Rive content. Before, a script drew its passes into its own GPUCanvas first. The target can't be sampled and starts each frame empty, so the first pass must clear or cover it. Where a host can't expose its target, context:gpuTarget() returns nil, so keep a GPUCanvas as the fallback.
๐ event.type in a Node script's pointerDown, pointerMove, pointerUp and pointerExit now reports the real event. Before, it always read "pointerEnter".
๐จ๏ธ print("a", 1) now logs a and 1 separated by a tab, like standard Luau. Before, it logged a1. As reported here.
RML (the markup the CLI compiles)
๐ State machine inputs and listeners inside a folder now export. Before, the build left them out of the .riv and reported 0 errors, 0 warnings, and everything that pointed at them went too: a blend state driven by inputs in a folder mixed nothing.
๐จ The build now fails on a reference to an object it didn't export. Before, the reference was dropped and the build passed. The error names both ends:
TranslationConstraint targetId="0:12" targets a Node that is not exported.๐ A path's winding now comes only from isClockwise. pathFlags in markup is ignored and computed at build time, the way the editor does it. Before, the viewer read the winding from pathFlags, so a path whose pathFlags disagreed with isClockwise could fail to show up.
๐งญ A state machine layer with only an Entry state now gets its Any State and Exit state added at build time, and their ids are written back into your markup so they stay the same across pushes. Before, the editor removed a layer missing either one when the file opened, taking its states, transitions, conditions and actions with it.
๐ข DataConverterEnumToUint is no longer exported, matching the editor. Before, the runtime skipped it and every converter after it shifted one place, so binds landed on the wrong converter. rive inspect reports editor-only-converter when it feeds anything but a number property, and points to DataConverterToNumber. As reported here.
โจ rive inspect reports scripted-path-effect-not-under-paint when a ScriptedPathEffect sits directly under a Shape. It belongs inside a Fill, Stroke or GroupEffect; under a Shape the file failed to load with a re-import error, and the docs showed exactly that placement. The docs are fixed too. As reported here.
๐๏ธ ListenerViewModelChange takes inputValue (pointerX, keyPressed, gamepadAxis and others) to write the value of the input that fired the listener, the markup side of the listener values feature in Rive Editor 0.9.46. inputValueIndex picks the gamepad button or axis.