libobs: Add function to force a sceneitem transform update

Useful when you need to modify transform properties of group sub-items
and have the transform available immediately (group sub-items always
automatically defer their transform update to the next frame).
This commit is contained in:
jp9000 2018-08-16 08:42:19 -07:00
parent b5022385d1
commit e6dd009386
2 changed files with 11 additions and 0 deletions

View file

@ -2885,3 +2885,12 @@ void obs_sceneitem_group_enum_items(obs_sceneitem_t *group,
if (scene)
obs_scene_enum_items(scene, callback, param);
}
void obs_sceneitem_force_update_transform(obs_sceneitem_t *item)
{
if (!item)
return;
if (os_atomic_set_bool(&item->update_transform, false))
update_item_transform(item, false);
}

View file

@ -1427,6 +1427,8 @@ EXPORT void obs_sceneitem_set_scale_filter(obs_sceneitem_t *item,
EXPORT enum obs_scale_type obs_sceneitem_get_scale_filter(
obs_sceneitem_t *item);
EXPORT void obs_sceneitem_force_update_transform(obs_sceneitem_t *item);
EXPORT void obs_sceneitem_defer_update_begin(obs_sceneitem_t *item);
EXPORT void obs_sceneitem_defer_update_end(obs_sceneitem_t *item);