Cazzar / VTubeStudio-StreamDeck

16 stars 3 forks source link

Activate/Deactivate Expression Command #29

Open Houdini111 opened 10 months ago

Houdini111 commented 10 months ago

VTube Studio supports the ability to idempotently set the state of expressions (toggles). This functionality should theoretically allow users to define multi-stage switches. For example, a model may have a jacket with a hood which can be lowered or the jacket removed entirely. With the current functionality of only toggles the user must actively look at the model, check which state it is in, and then decide what to press. If the jacket was off and the hoot down, they would first have to press the "jacket on" toggle, see that the hood is down, and then press the hood toggle. This cannot be made into a multi-action because if the hood was on previously then toggling both would instead put the hood down. VTube Studio supports the ability to set a toggle instead of set it, however this is not present in the UI. The documentation for this feature can be found here ( https://github.com/DenchiSoft/VTubeStudio#requesting-activation-or-deactivation-of-expressions). As a plugin for VTS it should be possible to expose this functionality to the user.

I attempted to create the change myself but could not figure out how to run your project. Here's a git patch of them that you can try to use as a starting point. ExpressionActivation.patch

Cazzar commented 10 months ago

Hey! Thanks for the request - Right now I have been quite busy and unable to add much more - if you were wanting to do this I would happily accept contributions.

What would be a good starting base to try and do this, is if you have a look at how ChangeModelAction.cs is implemented alongside it's registration here: https://github.com/Cazzar/VTubeStudio-StreamDeck/blob/ad750514fe69155a856381d60b0bd77b67241d95/streamdeck-vtubestudio/manifest.json#L3-L17

Also if needed, you can load the ConsoleApp1 project as a way with the debug mode to "load" the plugin via running in your IDE, though that is a very hacky way once you have the manifest, as it requires custom replacing the vtubestudio-streamdeck.exe in App Data.

Houdini111 commented 9 months ago

I did try but I'm just unable to get the repo running. I've not developed a StreamDeck plugin before and the way yours is set up doesn't match what I'm seeing for suggestions on how to make a plugin, so I don't know what I need to do to run it.

AkumuDesu commented 2 days ago

I wanted to bump up this one because i am also looking for this feature. And since it was a almost a year ago i wanted to ask if this is something that might get added in the near future. I sadly dont understand coding myself so i can't help with any suggestions.

I use for example "Trigger Hotkey" for toogleing Expressions and it would be nice to have the active/un-active icon choice. https://help.elgato.com/hc/en-us/articles/360028237271-Elgato-Stream-Deck-Customizing-Key-Icons#h_01H26T4Q31PAZ3W6YZHHMZYPXE

This is was i am looking for basicly.

AkumuDesu commented 2 days ago

I tried to do some "experimental" copy paste coding. I found a toogle on https://github.com/BarRaider/streamdeck-obstools/blob/master/streamdeck-obstools/manifest.json under "Studio Mode Toggle" and tried to copy it and change the picture direction and generated a off pciture. But once i safed the manifesto locally the plugin broke and cant connect to VTS anymore.

"Icon": "vts_logo_transparent", "Name": "Trigger Hotkey", "States": [ { "Image": "vts_logo_transparent", "TitleAlignment": "bottom", "FontSize": "10" }, { "Image": "vts_logo_transparent", "Name": "Enable" }, { "Image": "vts_logo_transparent_off", "Name": "Disable" }, ], "SupportedInMultiActions": true, "Tooltip": "VTubeStudio [Trigger Hotkey]", "UUID": "dev.cazzar.vtubestudio.triggerhotkey", "PropertyInspectorPath": "PropertyInspector/TriggerHotkey.html" },

But yeh it broke and i revesed the changes. Dunno if you need to change something in the property inspector or not

Cazzar commented 2 days ago

This is something I will eventually get to, as this is a side project I can only work on during my free time, which can sometimes be very sparse due to life and other. factors.

I have left this open as I do see it being a valuable possible addition, and until it is a feature in the plugin, this acts as a record of the feature request.


What looks to have happened @AkumuDesu is you gave the StreamDeck plugin invalid JSON "Name": "Disable" }, ], "SupportedInMultiActions": true the comma after the } is not supposed to be there.

Screenshot from my IDE showing the error:

image

If you use an editor that supports linting such as VSCode or paste the manifest in https://jsonlint.com/ it should give you an idea on if the overall syntax is correct.

AkumuDesu commented 1 day ago

Thank you, gues i made an error there. I redid it and got it to work. It's simple as you had it posted. As i mentioned i had a picture added names as "vts_logo_transparent_off.png" in the folder (just the same picture just in gray) And changed the manifesto part of "Trigger hotkey" into this

 {
            "Icon": "vts_logo_transparent",
            "Name": "Trigger Hotkey",
            "States": [
                {
                    "Image": "vts_logo_transparent",
                    "TitleAlignment": "bottom",
                    "FontSize": "10"
                },
                {
                    "Image": "vts_logo_transparent_off",
                    "Name": "Pressed"
                }
            ],
            "SupportedInMultiActions": true,
            "Tooltip": "VTubeStudio [Trigger Hotkey]",
            "UUID": "dev.cazzar.vtubestudio.triggerhotkey",
            "PropertyInspectorPath": "PropertyInspector/TriggerHotkey.html"
        },

The Name is somethiing i just added and can be changed however you want. You can also afterwards just pic your Own icon in the inspector

grafik

So if you want to add it you can use the picture i used for it. Maybe its better to make the picture order reverse since you have to "press it" to make it active. If you want i can rewrite it for you if you dont have the time for it. But anyways here also the picture i added.

vts_logo_transparent_off