Skip to content

Conversation

@IronJeff80
Copy link

fixes for OBS 32

fixes for OBS 32
@IronJeff80
Copy link
Author

This should allow this script to work in OBS 32.0.4, previously in 32, it would fail to hide source after playing.

@exeldro
Copy link
Owner

exeldro commented Jan 9, 2026

I see mainly code cleanup, what part is required for OBS 32?

@IronJeff80
Copy link
Author

IronJeff80 commented Jan 9, 2026 via email

@IronJeff80
Copy link
Author

I was getting this error: (attempt to call field 'obs_sceneitem_list_release' (a nil value).
In the OBS API, the function is specifically obs.sceneitem_list_release.
In OBS Lua, obs_data_array objects are 0-indexed (they start at 0), but your loop was trying to access an index equal to the total count, which is empty.
I changed this:
for i = 0, count do
local item = obs.obs_data_array_item(sourceNames, i);

To this:
for i = 0, count - 1 do
local item = obs.obs_data_array_item(sourceNames, i);

@exeldro
Copy link
Owner

exeldro commented Jan 9, 2026

So the fixes are not for OBS 32, but for all versions of OBS

@IronJeff80
Copy link
Author

IronJeff80 commented Jan 9, 2026 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants