Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requesthandler: Update scene item transform API #1203

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/requesthandler/RequestHandler_SceneItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ RequestResult RequestHandler::DuplicateSceneItem(const Request &request)
bool sceneItemEnabled = obs_sceneitem_visible(sceneItem);
obs_transform_info sceneItemTransform;
obs_sceneitem_crop sceneItemCrop;
obs_sceneitem_get_info(sceneItem, &sceneItemTransform);
obs_sceneitem_get_info2(sceneItem, &sceneItemTransform);
obs_sceneitem_get_crop(sceneItem, &sceneItemCrop);

// Create the new item
Expand Down Expand Up @@ -386,7 +386,7 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request)
bool cropChanged = false;
obs_transform_info sceneItemTransform;
obs_sceneitem_crop sceneItemCrop;
obs_sceneitem_get_info(sceneItem, &sceneItemTransform);
obs_sceneitem_get_info2(sceneItem, &sceneItemTransform);
obs_sceneitem_get_crop(sceneItem, &sceneItemCrop);

OBSSource source = obs_sceneitem_get_source(sceneItem);
Expand Down Expand Up @@ -503,7 +503,7 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request)
return RequestResult::Error(RequestStatus::CannotAct, "You have not provided any valid transform changes.");

if (transformChanged)
obs_sceneitem_set_info(sceneItem, &sceneItemTransform);
obs_sceneitem_set_info2(sceneItem, &sceneItemTransform);

if (cropChanged)
obs_sceneitem_set_crop(sceneItem, &sceneItemCrop);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/Obs_ObjectHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ json Utils::Obs::ObjectHelper::GetSceneItemTransform(obs_sceneitem_t *item)

obs_transform_info osi;
obs_sceneitem_crop crop;
obs_sceneitem_get_info(item, &osi);
obs_sceneitem_get_info2(item, &osi);
obs_sceneitem_get_crop(item, &crop);

OBSSource source = obs_sceneitem_get_source(item);
Expand Down