Feature Request: Request to see if expressions are set/unset
See original GitHub issueThe ability to see which expressions are set and unset would allow for potentially fluid transitions/swaps between expressions.
Proposal:
One function added to API ExpressionStateRequest
(this could also potentially be rolled into the hotkey request since that will return only expressions that can be toggled via the API).
Potential implementation:
REQUEST
{
"apiName": "VTubeStudioPublicAPI",
"apiVersion": "1.0",
"requestID": "SomeID",
"messageType": "ExpressionStateRequest",
"data": {
"expressionID": "Optional_ExpressionFileName",
}
}
If an ExpressionFileName
is provided the return Array will have a single item containing only that Expression.
It might also make sense to expose expressions via unique IDs.
RESPONSE
{
"apiName": "VTubeStudioPublicAPI",
"apiVersion": "1.0",
"timestamp": 1625405710728,
"requestID": "SomeID",
"messageType": "ExpressionStateResponse",
"data": {
"modelLoaded": true,
"modelName": "My Currently Loaded Model",
"modelID": "UniqueIDOfModel",
"expressionStates": [
{
"file": "myExpression_1.exp3.json",
"expressionSet": true
},
{
"file": "myExpression_2.exp3.json",
"expressionSet": false
}
]
}
}
Use Case:
In my case my model (an MLP:FiM style unicorn wearing an umbreon kigurumi) has a base model with no mane:
and two (relevant) available expressions:
- “Hood Down” which places a normal mane on the model:
- and “Hood Up” which puts the hood up:
To swap between the two I have to make sure to set/unset both or I get a weird chunk of man outside the hood:
Currently I am using Cazzar’s plugin for the Stream Deck and running a multi-action to set/unset both simultaneously. In one direction it looks pretty ok, in the other it will always flash to the no mane at all look for a fraction of a second. However with the proposed change I (and others) could set and unset the expressions in the order that looks best on stream.
Example of how that might work:
bool isHoodUp = <API Request Result>
if(isHoodUp) {
<SendRequest ToggleHoodDown>
<SendRequest ToggleHoodUp>
} else {
<SendRequest ToggleHoodUp>
<SendRequest ToggleHoodDown>
}
(note how the order is swapped in each half of the if/else)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top GitHub Comments
I’ll take a look in the next couple days. Life got a little busy, but I’ll definitely give it a go when I can.
This is now implemented in the new
ExpressionStateRequest
(see documentation). There is also theExpressionActivationRequest
to directly activate and deactivate expressions independently of hotkeys.Both are available on the beta branch (version 1.15.10 or newer). Could you please give it a try and let me know if they work as expected?
Info on how to get on the beta branch can be found in the VTube Studio Discord in the #beta_info channel.