grigio / obs-cmd

obs-cmd is a OBS cli for obs-websocket v5 the current obs-studio implementation. It is useful on Wayland Linux or to control OBS via terminal
MIT License
102 stars 16 forks source link

[feature request] toggle a scene filter #46

Open soulchainer opened 4 months ago

soulchainer commented 4 months ago

Hi. First of all, thanks for this piece of software :green_heart:.

I have tried it and it works so well for me when I try to toggle a scene item with

obs-cmd scene-item toggle <scene> <item>.

But it doesn't have any option (as far as I know) to toggle a scene filter.

Is there any possibility to add a command to toggle that? Something like:

obs-cmd scene-filter toggle <scene> <filter-item>.

That would be pretty useful, specially to allow to automate usage of some specific plugins, like obs-move-transition. I want to do that using the streamdeck, but I could only achieve that if I'm able of doing such thing via commands and there is no simple/practical way of achieve that.

I know that this is supposed to have a minimal API, with I think this feature could be useful enough to be considered.

salt86 commented 3 weeks ago

Oh this is exactly what I'm looking for. I made a post, which I'll delete right now.

salt86 commented 1 week ago

It seems as though this is already possible. the syntax is as follows

obs-cmd filter

This can be done for a source or scene.

soulchainer commented 1 week ago

It seems as though this is already possible. the syntax is as follows

obs-cmd filter

This can be done for a source or scene.

Hi.

Sorry, but according to the code is not possible at the moment. The syntax doesn't seem to be like you said, because you're not specifying any scene or source in the example source you're providing (so the command wouldn't even know over which specific scene you want to toggle such filter).

According to current code:

"filter" => {
            if args.len() < 5 {
                println!("Usage: ./program filter <command> <source-name> <filter-name>");
                return Ok(());
            }

it can be done currently over a source (source-name). It could be done over a source also at the moment I created this issue. But not over a scene, which is different from a source inside of a scene, which, according to your previous issue, was what you were seeking (and yes, that was already possible), but not what this issue is about ;) .

Or I'm missing something. If you, for real, can toggle the filter over a main scene (not an scene inside another either) instead of toggling a filter over a source inside a scene (different things, already possible), even when the current code I'm looking at seems to say otherwise, I would be grateful to know how with complete syntax and probably code and README of the project should be updated to properly reflect that possibility. Thanks.