superlou
New Member
I am working on a plugin to simplify the use of "down-stream key" scenes.
For this example, I have a basic scene called "Scene 1" containing my main video scene. I also have a second "Bug DSK" scene that has a small looping video in the lower right.
In the frontend GUI, I perform the following steps:
1) Scene 1 in program and preview. Scene 1 does not contain Bug DSK and it is not showing in program.
2) Add Bug DSK to the Scene 1 source list. Bug DSK now shows overlayed in the preview monitor, but is not in the program monitor (which is exactly what I want).
3) Execute a Fade transition. The bug fades into the program monitor. It is still shown on the preview monitor.
4) Delete the Bug DSK source from the Scene 1 source list. The bug disappears from the preview monitor, but continues showing in the program monitor.
5) Execute a Fade transition. The bug fades from the program monitor (which is also exactly what I want).
So, now I do this in Lua, starting with Scene 1 in preview and program, not containing the Bug DSK scene, as before:
This is awesome. It behaves the same as in steps 1, 2, and 3. However, now when I manually go to perform step 4 (delete the Bug DSK source), it immediately disappears from program, as well as preview. If I run the Lua script again at this point, the bug immediately appears in program; it doesn't transition in.
I noticed that if I run the script, and then execute a transition using the GUI buttons, behavior when performing 4 and 5 manually is as expected.
So, is there something like an obs_transition_end(...) or other call that is required? Is the behavior in steps 1 through 5 by design, or am I trying to make use of undefined behavior?
For this example, I have a basic scene called "Scene 1" containing my main video scene. I also have a second "Bug DSK" scene that has a small looping video in the lower right.
In the frontend GUI, I perform the following steps:
1) Scene 1 in program and preview. Scene 1 does not contain Bug DSK and it is not showing in program.
2) Add Bug DSK to the Scene 1 source list. Bug DSK now shows overlayed in the preview monitor, but is not in the program monitor (which is exactly what I want).
3) Execute a Fade transition. The bug fades into the program monitor. It is still shown on the preview monitor.
4) Delete the Bug DSK source from the Scene 1 source list. The bug disappears from the preview monitor, but continues showing in the program monitor.
5) Execute a Fade transition. The bug fades from the program monitor (which is also exactly what I want).
So, now I do this in Lua, starting with Scene 1 in preview and program, not containing the Bug DSK scene, as before:
...
obs.obs_scene_add(obs.obs_scene_from_source(scene1), dsk)
obs.obs_transition_start(fade, obs.OBS_TRANSITION_MODE_AUTO, 2000, current)
obs.obs_scene_add(obs.obs_scene_from_source(scene1), dsk)
obs.obs_transition_start(fade, obs.OBS_TRANSITION_MODE_AUTO, 2000, current)
This is awesome. It behaves the same as in steps 1, 2, and 3. However, now when I manually go to perform step 4 (delete the Bug DSK source), it immediately disappears from program, as well as preview. If I run the Lua script again at this point, the bug immediately appears in program; it doesn't transition in.
I noticed that if I run the script, and then execute a transition using the GUI buttons, behavior when performing 4 and 5 manually is as expected.
So, is there something like an obs_transition_end(...) or other call that is required? Is the behavior in steps 1 through 5 by design, or am I trying to make use of undefined behavior?