Get list of all scenes in LUA script

SN1974

New Member
I am working on a script to mark a source visible (or not visible) in all scenes where that source appears. I have tried using obs_enum_scenes() to get all scenes and then loop through them similar to the way obs_enum_sources() works. The line where I call obs_enum_scenes() throws an error

Error in obs_enum_scenes expected 2..2 args, got 0

I want to loop through all scenes because the same source might be duplicated (as a reference) in multiple scenes and I would need to change the visibility of that souce in all of the scenes where that source is referenced.

Looking at the API documentation I found that obs_enum_sources() has a different function for scripting vs C where obs_enum_scenes() does not have a specific function defined for scripting.

Admittedly I have never done any amount of C programing so I'm starting to get a bit lost.

Is there a way I can make a source visible (or not) in all scenes without the obs_enum_scenes() or is there a way to use that function in LUA scripting that I'm missing?

Thanks
SN1974
 
Last edited:

Luky_

New Member
Hopefully that's just me doing something wrong
And indeed it was, just me being silly only adding the signal handler on the current scene instead of all of them. You should be fine. Sorry for the double-post.
 

SN1974

New Member
Thank you very much. I'm going to need to look more often at the frontend docs. This is the second time I've gotten tripped up by not looking there.
 
Top