From 0e8650dbd2ae8f939aa73ed6f1dd51314f798ee8 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 25 Sep 2021 18:45:37 -0700 Subject: [PATCH] Requests: Support groups in GetSceneItemId --- src/requesthandler/RequestHandler_SceneItems.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/requesthandler/RequestHandler_SceneItems.cpp b/src/requesthandler/RequestHandler_SceneItems.cpp index cb1f7471..fc2d5d21 100644 --- a/src/requesthandler/RequestHandler_SceneItems.cpp +++ b/src/requesthandler/RequestHandler_SceneItems.cpp @@ -32,11 +32,16 @@ RequestResult RequestHandler::GetSceneItemId(const Request& request) { RequestStatus::RequestStatus statusCode; std::string comment; - OBSSourceAutoRelease sceneSource = request.ValidateScene("sceneName", statusCode, comment); + OBSSourceAutoRelease sceneSource = request.ValidateScene("sceneName", statusCode, comment, OBS_WEBSOCKET_SCENE_FILTER_SCENE_OR_GROUP); if (!(sceneSource && request.ValidateString("sourceName", statusCode, comment))) return RequestResult::Error(statusCode, comment); OBSScene scene = obs_scene_from_source(sceneSource); + if (!scene) { + scene = obs_group_from_source(sceneSource); + if (!scene) // This should never happen + return RequestResult::Error(RequestStatus::GenericError, "Somehow the scene was found but the scene object could not be fetched. Please report this to the obs-websocket developers."); + } std::string sourceName = request.RequestData["sourceName"];