diff --git a/docs/sphinx/reference-scenes.rst b/docs/sphinx/reference-scenes.rst index d8eee24e8a091a..0fe40aeb0de2ef 100644 --- a/docs/sphinx/reference-scenes.rst +++ b/docs/sphinx/reference-scenes.rst @@ -326,6 +326,11 @@ Scene Item Functions :return: The sceneitem associated with a source in a scene. Returns NULL if not found. + .. deprecated:: 31.0 + This function is problematic because there can be multiple items of the same source in a scene. + In that case, which of those this function will return is undefined. + If this is the behavior you need, manually use :c:func:`obs_scene_enum_items` instead. + --------------------- .. function:: void obs_sceneitem_set_id(obs_sceneitem_t *item); diff --git a/libobs/obs.h b/libobs/obs.h index 0e366cc0aa6dc8..23bd3defeb1b60 100644 --- a/libobs/obs.h +++ b/libobs/obs.h @@ -1806,8 +1806,8 @@ EXPORT void obs_sceneitem_save(obs_sceneitem_t *item, obs_data_array_t *arr); EXPORT void obs_sceneitem_set_id(obs_sceneitem_t *sceneitem, int64_t id); /** Tries to find the sceneitem of the source in a given scene. Returns NULL if not found */ -EXPORT obs_sceneitem_t *obs_scene_sceneitem_from_source(obs_scene_t *scene, - obs_source_t *source); +OBS_DEPRECATED EXPORT obs_sceneitem_t * +obs_scene_sceneitem_from_source(obs_scene_t *scene, obs_source_t *source); /** Save all the transform states for a current scene's sceneitems */ EXPORT obs_data_t *obs_scene_save_transform_states(obs_scene_t *scene,