Find a scene filter and enable/disable it

Xunkar

New Member
I'm making a python script for OBS and woud like to do that. I don't think obs_source_get_filter_by_name can be used on scenes, so how can I access the filter list? And once done, how do I enable the filter? I cannot find this info in the doc, sorry.
 

Xunkar

New Member
Ah I get it, both scenes and filters are actually obs_source_t so, it's possible to do it like that:

Python:
scene = obs.obs_frontend_get_current_scene()
filtr = obs.obs_source_get_filter_by_name(scene, "MyFilter")
if filtr is not None:
    obs.obs_source_set_enabled(filtr, True)
 
Top