diff --git a/docs/sphinx/reference-scenes.rst b/docs/sphinx/reference-scenes.rst index 9f01813bd..8f13c4354 100644 --- a/docs/sphinx/reference-scenes.rst +++ b/docs/sphinx/reference-scenes.rst @@ -135,6 +135,11 @@ Scene Signals Called when scene items have been reoredered in the scene. +**refresh** (ptr scene) + + Called when the entire scene item list needs to be refreshed. + Usually this is only used when groups have changed. + **item_visible** (ptr scene, ptr item, bool visible) Called when a scene item's visibility state changes. diff --git a/libobs/obs-scene.c b/libobs/obs-scene.c index 294c64ff7..6ac83b79a 100644 --- a/libobs/obs-scene.c +++ b/libobs/obs-scene.c @@ -48,6 +48,7 @@ static const char *obs_scene_signals[] = { "void item_add(ptr scene, ptr item)", "void item_remove(ptr scene, ptr item)", "void reorder(ptr scene)", + "void refresh(ptr scene)", "void item_visible(ptr scene, ptr item, bool visible)", "void item_select(ptr scene, ptr item)", "void item_deselect(ptr scene, ptr item)", @@ -1919,6 +1920,18 @@ static inline void signal_reorder(struct obs_scene_item *item) signal_parent(item->parent, command, ¶ms); } +static inline void signal_refresh(obs_scene_t *scene) +{ + const char *command = NULL; + struct calldata params; + uint8_t stack[128]; + + command = "refresh"; + + calldata_init_fixed(¶ms, stack, sizeof(stack)); + signal_parent(scene, command, ¶ms); +} + void obs_sceneitem_set_order(obs_sceneitem_t *item, enum obs_order_movement movement) {