dqm
Member
I have an LUA script and I need to run some code when a source gets renamed. I've implemented the source rename signal two different ways:
local sh = obs.obs_get_signal_handler()
obs.signal_handler_connect(sh,"source_rename",onSourceRename) --rename callback
local sh = obs.obs_source_get_signal_handler(source)
obs.signal_handler_connect(sh,"rename",onSourceRename) --rename callback
Either way, the onSourceRename function is invoked.
My issue is that, in the function code, I cannot figure out how to ascertain the new_name and prev_name strings which are supposed to be passed to the callback function.
This returns nil in the second and third parameters:
function onSourceRename(source, newName, oldName)
And this returns nil for both values, as well:
function onSourceRename(cd)
local source = obs.calldata_source(cd,"source")
local newName = obs.calldata_source(cd,"new_name")
local oldName = obs.calldata_source(cd,"prev_name")
Does anyone have a working example of how to retrieve the old/new names in the source_rename callback?
local sh = obs.obs_get_signal_handler()
obs.signal_handler_connect(sh,"source_rename",onSourceRename) --rename callback
local sh = obs.obs_source_get_signal_handler(source)
obs.signal_handler_connect(sh,"rename",onSourceRename) --rename callback
Either way, the onSourceRename function is invoked.
My issue is that, in the function code, I cannot figure out how to ascertain the new_name and prev_name strings which are supposed to be passed to the callback function.
This returns nil in the second and third parameters:
function onSourceRename(source, newName, oldName)
And this returns nil for both values, as well:
function onSourceRename(cd)
local source = obs.calldata_source(cd,"source")
local newName = obs.calldata_source(cd,"new_name")
local oldName = obs.calldata_source(cd,"prev_name")
Does anyone have a working example of how to retrieve the old/new names in the source_rename callback?