question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Request to see if expressions are set/unset

See original GitHub issue

The 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:

image

and two (relevant) available expressions:

  • “Hood Down” which places a normal mane on the model: image
  • and “Hood Up” which puts the hood up: image

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: image

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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Bpendragoncommented, Jan 5, 2022

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.

1reaction
DenchiSoftcommented, Jan 5, 2022

This is now implemented in the new ExpressionStateRequest (see documentation). There is also the ExpressionActivationRequest 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run a job when a variable is set/unset and it's a merge ...
I want a job to run when 2 conditions are met: There has been a merge request on the branch; A specific variable...
Read more >
New Feature Request Related to Rebuilt Table
It would be nice if there was either a setting or when running the Rebuild Table there was an Option or a check...
Read more >
Request body support for JS expressions · Issue #3768 ...
We will try to look into supporting more ES6 JS features. I'll let you know here when we make progress. 👍 1
Read more >
Feature Request - Repeating group with a checkbox selector
I have this “sort of” working where the checkbox set/unset is based on presence in the external list and the onchange event adds/removes...
Read more >
How can you get a conditional execution of a query...
This only executes the first part of the query: "index=_internal sourcetype=FilmWork . But for all results, it does no lookup or search feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found