VTube Studio script functions¶
Functions for C# (Cb.Call) and Python (cb.call). See Script functions for how to use them.
vtubestudio.getCurrentModel¶
Tells you which model VTube Studio has loaded and where it is on screen. Fails with an error when VTube Studio is not connected.
Gives back: loaded (true/false), name, id, positionX, positionY, rotation and size.
var answer = await Cb.Call("vtubestudio.getCurrentModel");
answer = cb.call("vtubestudio.getCurrentModel")
vtubestudio.getExpressions¶
Lists the face expressions of the model that is loaded now, and which ones are on. Fails with an error when VTube Studio is not connected.
Gives back: A list of expressions. Each has name, file and active (true when it is on).
var answer = await Cb.Call("vtubestudio.getExpressions");
answer = cb.call("vtubestudio.getExpressions")
vtubestudio.getHotkeys¶
Lists the hotkeys of the model that is loaded now. Fails with an error when VTube Studio is not connected.
Gives back: A list of hotkeys. Each has id, name, type (what it does) and file.
var answer = await Cb.Call("vtubestudio.getHotkeys");
answer = cb.call("vtubestudio.getHotkeys")
vtubestudio.injectParameters¶
Sets tracking values on your model for a while, like tilting the head or opening the mouth. Your script waits until the time is over.
| Value | What to put in |
|---|---|
parameters |
The values as text, like "FaceAngleX=20, MouthOpen=1". You can also give an object, like {"FaceAngleX": 20}. |
holdSeconds |
Optional. How many seconds to keep the values, 0 to 3600. Default 1. |
mode |
Optional. "add" adds the values to the tracking. Anything else (the default) replaces the tracking values. |
faceFound |
Optional. true tells VTube Studio to act as if it sees your face while the values are sent. Starts as false. |
Gives back: true when done.
var answer = await Cb.Call("vtubestudio.injectParameters", new { parameters = "FaceAngleX=20, MouthOpen=1", holdSeconds = 3 });
answer = cb.call("vtubestudio.injectParameters", parameters="FaceAngleX=20, MouthOpen=1", holdSeconds=3)
vtubestudio.isConnected¶
Checks whether Cuebot is connected to VTube Studio and allowed in as a plugin.
Gives back: true while connected and allowed, otherwise false.
var answer = await Cb.Call("vtubestudio.isConnected");
answer = cb.call("vtubestudio.isConnected")
vtubestudio.loadModel¶
Switches VTube Studio to another model. Fails with an error when no model has that name or VTube Studio is not connected.
| Value | What to put in |
|---|---|
model |
The model's name as VTube Studio shows it, like "Akari", or its id. |
Gives back: The id of the model that was loaded.
var answer = await Cb.Call("vtubestudio.loadModel", new { model = "Akari" });
answer = cb.call("vtubestudio.loadModel", model="Akari")
vtubestudio.moveModel¶
Moves, turns or resizes your model on screen. Values you leave out stay as they are. Fails with an error when VTube Studio is not connected.
| Value | What to put in |
|---|---|
time |
Optional. How long the move takes, 0 to 2 seconds. Default 0.5. |
relative |
Optional. true moves the model by these amounts from where it is now. false (default) moves it to these exact values. |
positionX |
Optional. Left/right position: -1 is the left edge, 1 is the right edge. |
positionY |
Optional. Up/down position: -1 is the bottom edge, 1 is the top edge. |
rotation |
Optional. How far to turn the model, in degrees, like 15. |
size |
Optional. The model's size, from -100 (small) to 100 (big). |
Gives back: true when done.
var answer = await Cb.Call("vtubestudio.moveModel", new { time = 1, positionX = 0.5, positionY = -0.2 });
answer = cb.call("vtubestudio.moveModel", time=1, positionX=0.5, positionY=-0.2)
vtubestudio.request¶
Sends any VTube Studio API request and gives back its answer. For advanced users who know VTube Studio's request names.
| Value | What to put in |
|---|---|
messageType |
The request name, like "StatisticsRequest". Needed. |
data |
Optional. The request's settings as an object, like {"hotkeyID": "Wave"}. |
Gives back: VTube Studio's answer data, or null when it sent none.
var answer = await Cb.Call("vtubestudio.request", new { messageType = "StatisticsRequest" });
answer = cb.call("vtubestudio.request", messageType="StatisticsRequest")
vtubestudio.setExpression¶
Turns a face expression on your model on or off, like blush or angry eyes. Fails with an error when VTube Studio is not connected.
| Value | What to put in |
|---|---|
expression |
The expression's name or file, like "Blush" or "Blush.exp3.json". |
state |
Optional. "On", "Off" or "Toggle" (switch). Default "On". |
fadeTime |
Optional. How many seconds the change takes to fade in or out. Leave it out for 0.25 seconds. |
Gives back: The new state: true for on, false for off.
var answer = await Cb.Call("vtubestudio.setExpression", new { expression = "Blush", state = "On" });
answer = cb.call("vtubestudio.setExpression", expression="Blush", state="On")
vtubestudio.triggerHotkey¶
Runs one of your VTube Studio hotkeys, like a wave or an outfit change. Fails with an error when VTube Studio is not connected.
| Value | What to put in |
|---|---|
hotkey |
The hotkey's name as VTube Studio shows it, like "Wave", or its id. |
itemInstanceId |
Optional. The id of a Live2D item, to press that item's hotkey instead of the model's. Most people leave it out. |
Gives back: The id of the hotkey that ran.
var answer = await Cb.Call("vtubestudio.triggerHotkey", new { hotkey = "Wave" });
answer = cb.call("vtubestudio.triggerHotkey", hotkey="Wave")