In a handler for OBS_FRONTEND_EVENT_SCENE_CHANGED obs_source_set_enabled works, but obs_sceneitem_set_visible doesn't

In a handler for OBS_FRONTEND_EVENT_SCENE_CHANGED or OBS_FRONTEND_EVENT_PREVIEW_SCENE_CHANGED
events, I can call obs_source_set_enabled on a source to show or hide a source.

But a call to obs_sceneitem_set_visible on a scene item containing a source doesn't do anything (although a later transition of the scene back to Preview WILL hide the item/source)

My code (see attached) is similar to the source-shake example, except that source-shake calls obs_sceneitem_set_visible in script_tick, while I do it
in a frontend event callback.

Is there some sort of "refresh" function that I need to call?

Scene collection and script renamed since the forum won't let me update the files under their real names.
 

Attachments

  • Hidey.json.txt
    4.3 KB · Views: 8
  • Hider.lua.txt
    2.3 KB · Views: 16
Top