Docs

Ayatsuri API

Ayatsuri2D speaks Cubism Editor's External Application Integration API, built from Live2D's published documentation, so apps made for Cubism Editor connect to Ayatsuri2D unchanged. VTube Studio's parameter sync is the usual one: the model's parameters move in Ayatsuri2D as you move in front of the camera, which is how you check a rig before you export it.

Turning it on

The API menu in the menu bar turns the server on and off and shows its state: Listening on port 22033, Off, or Could not start with the reason in the API window.

  • API Settings…: the Port (22033 is Cubism's default, so clients find Ayatsuri2D without setup; change it if Cubism Editor runs on the same machine) and Allow remote connections. Off, only apps on this computer can connect.
  • API Window…: status, every app that has connected, whether each is connected now and from where, the parameters it drives, and the messages coming in.

Allowing an app

The first time an app connects it asks for permission, and Ayatsuri2D shows Allow connection: <app> wants to connect to the Ayatsuri API. It will be able to read and drive this model's parameters. Allow or Deny.

An allowed app gets a token and is remembered, so it connects without asking next time, even after a restart. The API window and the API tab in Settings list every app: Disconnect drops it for now, Forget removes it so it must ask again.

What an app can do

An app can read the open model and drive its parameters. Driven parameters show the app's values in the Parameter palette while the app writes them; an override lapses half a second after the last write, as in Cubism, and the parameter returns to what you had. Nothing an app sends is saved into the model.

Methods served, from the published API:

Method What it does
GetAPIVersion, SetGlobalVersion Version handshake. Versions 0.9.0 to 1.0.1 are accepted.
RegisterPlugin Introduces the app, by name and token, and triggers the permission prompt.
GetIsApproval Whether the app has been allowed.
GetDocuments, GetDocument, GetCurrentDocumentUID The open model as documents.
GetCurrentModelUID, GetCurrentEditMode Which model, and whether the editor is in Modeling or Animation.
GetParameters, GetParameterGroups Every parameter with its range and default, and the palette's folders.
GetParameterValues, SetParameterValues, ClearParameterValues Read, drive and release parameters.
GetPhysicsInfo The physics groups.
SendCubismLog Lines the app wants in the API window's log.

Messages are JSON over a plain socket, one object per message: {Version, Timestamp, RequestId, Type, Method, Data}. Errors come back with Type: "Error" and Data.ErrorType, using Cubism's names (PluginNotRegistered, InvalidParameter, InvalidModel, InvalidJson, UnsupportedVersion, InvalidType, MethodNotFound).

Checking a rig with VTube Studio

  1. Open the model in Ayatsuri2D and turn the API on.
  2. In VTube Studio, open the model's settings and turn on the Cubism Editor connection (the default port matches).
  3. Allow VTube Studio when Ayatsuri2D asks.
  4. Move. The parameters follow in the Parameter palette, and the model moves on the canvas with the deformers and physics you are editing.

If nothing moves, open the API window: it shows whether VTube Studio is connected and which parameters it is sending.