mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
obs-scripting: Add obs_sceneitem_group_enum_items function call
Adds function call to enumerate over items contained in a source group.
This commit is contained in:
+19
@@ -1108,6 +1108,23 @@ static PyObject *scene_enum_items(PyObject *self, PyObject *args)
|
||||
return list;
|
||||
}
|
||||
|
||||
static PyObject *sceneitem_group_enum_items(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *py_sceneitem;
|
||||
obs_sceneitem_t *sceneitem;
|
||||
|
||||
UNUSED_PARAMETER(self);
|
||||
|
||||
if (!parse_args(args, "O", &py_sceneitem))
|
||||
return python_none();
|
||||
if (!py_to_libobs(obs_sceneitem_t, py_sceneitem, &sceneitem))
|
||||
return python_none();
|
||||
|
||||
PyObject *list = PyList_New(0);
|
||||
obs_sceneitem_group_enum_items(sceneitem, enum_items_proc, list);
|
||||
return list;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
static PyObject *source_list_release(PyObject *self, PyObject *args)
|
||||
@@ -1235,6 +1252,8 @@ static void add_hook_functions(PyObject *module)
|
||||
DEF_FUNC("sceneitem_list_release", sceneitem_list_release),
|
||||
DEF_FUNC("obs_enum_sources", enum_sources),
|
||||
DEF_FUNC("obs_scene_enum_items", scene_enum_items),
|
||||
DEF_FUNC("obs_sceneitem_group_enum_items",
|
||||
sceneitem_group_enum_items),
|
||||
DEF_FUNC("obs_remove_tick_callback",
|
||||
obs_python_remove_tick_callback),
|
||||
DEF_FUNC("obs_add_tick_callback", obs_python_add_tick_callback),
|
||||
|
||||
Reference in New Issue
Block a user