Resource icon

Scene Count Up Timer with Active Scene's Name 0.3

wilderf353

Member
wilderf353 submitted a new resource:

Scene Count Up Timer - When ever a scene is changed, the script starts a count up timer and identifies the scene's name

We use OBS Studio at my church with a multi-camera setup. With the idea that changing camera views enhances visual interest and it breaks up the monotony of a single head-shot during long segments, it is nice to rotate through the different cameras. The problem with changing cameras manually is that you need to keep track on how long the current camera has been displayed.

This script allows you to create a scene with both the name of the active scene and a count up timer. If used in...

Read more about this resource...
 

wre.specter

New Member
This nearly what I am looking for. Just an enhancement request. I seek to add a text field that will contain a scene unique note to the operator. It would not show up in either the preview or program window. It would be displayed in a "Source Dock" display. I want to set the text source as "Scene Note" in 'Source
SourceDock.jpg
Dock' "CurScene" window. In a 'program window' scene there would be a "Scene Note" text field that would contain something like "cue the actor". It would be made "not visible" in prog or prev. In the lua script I want to get the text from the scenes "Scene Note" property and set it into the 'Source Dock' "Scene Note" text field so that it shows when there is a scene change during a production. Kinda like a dynamic sticky note reminder. I hope this makes sense and that I am on the right track. Thanks for reading. Can you help or refer it to an expert?
 

wilderf353

Member
This nearly what I am looking for. Just an enhancement request...

If I understand you, I think something like this is possible...
  1. You would need to add a new text field to the dock. You will select it in step 2, in the "Dock note text target"
  2. I added two new fields in the lua script configuration tab. You would need to specify a "scene note" prefix. Example "note_". You would also need to specify the text field in the dock where the information should be displayed. Something like this:

    1636504049045.png


  3. You would then need to create a hidden text field for each scene, and name them "note_1", "note_2", "note_about bob", ... using the prefix identified in the "Scene note prefix".
  4. When the scene is active in the 'program window, the script will :
    • look at all the text fields in the scene until it finds one with the prefix. (example "note_1)"
    • read the text in the field, and update the text field in the "Dock note text target"
Does this make sense?
 

wre.specter

New Member
If I understand you, I think something like this is possible...
  1. You would need to add a new text field to the dock. You will select it in step 2, in the "Dock note text target"
  2. I added two new fields in the lua script configuration tab. You would need to specify a "scene note" prefix. Example "note_". You would also need to specify the text field in the dock where the information should be displayed. Something like this:

    View attachment 76909

  3. You would then need to create a hidden text field for each scene, and name them "note_1", "note_2", "note_about bob", ... using the prefix identified in the "Scene note prefix".
  4. When the scene is active in the 'program window, the script will :
    • look at all the text fields in the scene until it finds one with the prefix. (example "note_1)"
    • read the text in the field, and update the text field in the "Dock note text target"
Does this make sense?
 

wre.specter

New Member
Thanks for the quick response. Sorry for the reply delay. Been a couple of really busy days.
I'm not familiar with the All the OBS functions and do not understand how I would add code to the LUA script to "find the one with the prefix".
I think that your idea is perfect and easy to manage, but I'm just a little dense on how to code up the task.
I have google all the OBS API and LUA script API and no luck. I also see there are many others that a list of 'Sources' in scene.
I am hung up with how to get a source list for the current scene in either the program or preview screen. I would assume that there is a function like
local sceneSrc = obslua.obs_frontend_get_current_scene()
local sources = obs_get_sourcelist_in_scene(sceneSrc)
which I could use
ipairs(sources) to locate text fields and then use
local i, j = string.find(srcName, gprefix.text)
to get the Note text. I could not find such a thing.

Kinda like this below

function getNoteText()
logIt('in getNoteText')
local note_text = ""
local sceneSrc = obslua.obs_frontend_get_current_scene()
local sources = obs_get_sources_in_scene(sceneSrc)
if sources ~= nil then
logIt('sources = %s', sources)
for _, s in ipairs(sources) do
logIt('s = %s', s)
source_id = obs.obs_source_get_unversioned_id(s)
logIt('source_id = %s', source_id)
if source_id == "text_gdiplus" or source_id == "text_ft2_source" then
local srcName = obs.obs_source_get_name(s)
logIt('srcName = %s', srcName)
local i, j = string.find(srcName, gprefix.text)
if i ~= nil then
note_text = obslua.obs_propery_name(srcName)
end
end
end
end
end
logIt('note_text = %s', note_text)
return note_text
end

I also considered the following using all sources using
local sources = obs.obs_enum_sources()
and then finding each one that had a prefixed text field
and then seeing if the source was in the "current" scene.
I could not figure out how to determine which scene if any contained a "Note-" of interest.

I appreciate any help you could provide
 

wilderf353

Member
... I also considered the following using all sources using
local sources = obs.obs_enum_sources()
and then finding each one that had a prefixed text field
and then seeing if the source was in the "current" scene.
I could not figure out how to determine which scene if any contained a "Note-" of interest.

I appreciate any help you could provide

I can make the modifications, but I just want to make sure I understand what what you are looking for.
 

wre.specter

New Member
I can make the modifications, but I just want to make sure I understand what what you are looking for.
I am trying to get the text that is stored in the hidden 'Note-xxx' named source in the Current Program Scene so that it can be shown in the 'Source Dock' frame along with the timer, prog and prev text frames. Just can't find the text source in the current prog scene that might have the prefix 'Note-'. If there is no such text source in the scene, there should be no note text shown in the dock. Just the prev, prog, and timer which work great in your released code.
Also note that I think the two
obs.obs_source_release(currentSceneSrc) in the function onFrontendEvent(event)
should be
obs.obs_source_release(sceneSrc)
I don't see where 'currentSceneSrc' was defined or filled.
Also note that OBS crashes when I exit the program. Don't know what is causing this. Maybe unrelated.
Please forgive my lack of C knowledge. I coded JAVA for 10 years at the end of my career and before that COBAL, Fortran, Fortran5, and Machine Language for DG NOVA and for diode pin board custom hardware. Yes, I am old and retired and out of practice.
 

wilderf353

Member
wilderf353 updated Scene Count Up Timer with Active Scene's Name with a new update entry:

Scene Count Up Timer 03

Added the ability to display a hidden note from a scene in the dock.
  1. You would need to add a new text field to the dock with the count up timer (you will select it in step 2, in the "Dock note text target"). For this example, I am calling it "dock_note"
  2. Two new fields have been added to the lua script configuration tab. You would need to specify a "scene note" prefix: example "note_". You would also need to specify the text field in the dock where the information should be...

Read the rest of this update entry...
 
Top