Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>StallionNew to Visual Studio Code? Get it now.
Stallion

Stallion

Scenery

|
297 installs
| (1) | Free
Scripting bridge for Cavalry
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info
Stallion icon

stallion


VSCode extension to send scripts to Cavalry.

Features

  • Send scripts and Render scripts to Cavalry
  • Apply expressions to JavaScript- and SkSL layers
  • Insert Cavalry's Typescript definitions
  • Installs the Stallion script automatically
  • Functions as an API for other tools

Requirements

  • VSCode
  • Cavalry 1.5.2+

Installation

Install Stallion from the marketplace or look for "Stallion" in the VSCode extension tab and click the install button.

Usage

To send scripts to Cavalry the Stallion script needs to be open in Cavalry. After the extension is installed, the Stallion script should be available in Cavalry via Scripts > Stallion.

The VSCode extension exposes the following commands to the Command Palette (View > Command Palette).

  1. Send To Cavalry

    This will send the text from the active editor to Cavalry as a script. It doesn't have to be a saved file. Focus the Cavalry window and check the Log Window for any errors.

    If it was sucessful the Log Window will show:

    [Info]
    JavaScript: Stallion: Script successfully executed
    
  2. Send To Cavalry As…

    This will send the text from the active editor as an expression to Cavalry. It will apply the expression to the selected layers of the chosen type. If there is no selection it will create a layer of the chosen type.

    Render Scripts will be applied to all render queue items that are enabled, ie. the checkmark is visible. The Render Manager does not have to be open to apply Render Scripts.

    Choose to send it as:

    • JavaScript Shape
    • JavaScript Utility
    • JavaScript Modifier
    • JavaScript Deformer
    • JavaScript Emitter
    • SkSL Shader
    • SkSL Filter
    • Setup Script
    • Pre-Render Script
    • Post-Render Script
  3. Insert Cavalry Types

    This will enable auto-complete for Cavalry's scripting API. It inserts a comment at the top of the open editor which references the latest cavalry-types.

    Cavalry has various scripting namespaces that can be used in specific contexts eg. JavaScript Layers, Render Scripts, etc.

    Select one of the following contexts and it will expose only those types that are available in that context. The available contexts are:

    • script for Scripts with or without UI
    • plugin for Scripts that are part of a Plugin
    • shape for JavaScript Shapes
    • deformer for JavaScript Deformers
    • utility for JavaScript Utilities
    • emitter for JavaScript Particle Emitters
    • modifier for JavaScript Particle Modifiers
    • render for Setup, Pre- and Post-Render Scripts

Known Issues

  • The server address and port are hardcoded (127.0.0.1:8080). Make sure nothing else is using this port.
  • ui.scriptLocation returns a temporary path if the document in VSCode hasn't been saved.

Sending data to Stallion

While Stallion is open, send a POST request to http://127.0.0.1:8080/post with the following JSON

{
	"type": "",
	"code": "",
	"path": ""
}

type

String. The type of code that's sent. Typically one of the following:

  • script
  • javaScriptShape
  • javaScript (Utility)
  • javaScriptModifier
  • javaScriptDeformer
  • javaScriptEmitter
  • skslShader
  • skslFilter
  • renderSetupExpression
  • preRenderExpression
  • postRenderExpression

code

String. Required when type is a JavaScript layer, SkSL layer or a Render script.

The expression that should be applied to a layer—or the code that should be executed when type is script.

[!IMPORTANT] Sending UI scripts through code will result in the UI being appended to the Stallion UI. Use path instead.

path

String. Required when sending UI scripts.

The absolute path to a script. Mainly used for UI scripts so they're opened in their own window.

Sponsors

Huge thanks to Cavalry for sponsoring this project! Interested in sponsoring? Send us a message.

Cavalry

Icon Credits

The icon is Horse by Buztas Linggar from Noun Project

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft