LUA Script: source item loses properties

cnschu

New Member
Hi there,

i'm using a LUA Script to define a mediasource with custom properties.
everything seems to work fine (i can add the media source to scenes can change the properties and so on).
But if i restart OBS, all settings i Made in the properties dialog of the mediasource are reset to their default values.
It seems the properties are not saved by OBS persistently.

How do i define properties in a LUA Script, so that they are not lost on restart.

yours sincerly
Christian
 

cnschu

New Member
it seems that the properties are saved, but the update() function is not called after restarting OBS.
any idea what the reason might be?
 

WBE

Member
I don't know the answer, but based on what do you conclude that properties are saved?

Do you save them in function script_unload()?
 

cnschu

New Member
the properties will be saved, only .update waas not called at creation of the source.
I solved the problem by manually calling it at the end of the .create method.

Lua:
source_def.create = function(settings, source)
    (..)
    obs.obs_source_update(source, settings)
    return data
end
 
  • Like
Reactions: WBE
Top