A scene is a source which contains and renders other sources using specific transforms and/or filtering
A reference-counted scene object.
A reference-counted scene item object.
#include <obs.h>
Scene item transform structure.
Position.
Rotation (degrees).
Scale.
The alignment of the scene item relative to its position.
Can be 0 or a bitwise OR combination of one of the following values:
OBS_ALIGN_CENTER
OBS_ALIGN_LEFT
OBS_ALIGN_RIGHT
OBS_ALIGN_TOP
OBS_ALIGN_BOTTOM
Can be one of the following values:
OBS_BOUNDS_NONE - No bounding box
OBS_BOUNDS_STRETCH - Stretch to the bounding box without preserving aspect ratio
OBS_BOUNDS_SCALE_INNER - Scales with aspect ratio to inner bounding box rectangle
OBS_BOUNDS_SCALE_OUTER - Scales with aspect ratio to outer bounding box rectangle
OBS_BOUNDS_SCALE_TO_WIDTH - Scales with aspect ratio to the bounding box width
OBS_BOUNDS_SCALE_TO_HEIGHT - Scales with aspect ratio to the bounding box height
OBS_BOUNDS_MAX_ONLY - Scales with aspect ratio, but only to the size of the source maximum
The alignment of the source within the bounding box.
Can be 0 or a bitwise OR combination of one of the following values:
OBS_ALIGN_CENTER
OBS_ALIGN_LEFT
OBS_ALIGN_RIGHT
OBS_ALIGN_TOP
OBS_ALIGN_BOTTOM
The bounding box (if a bounding box is enabled).
Scene item crop structure.
Left crop value.
Top crop value.
Right crop value.
Bottom crop value.
Scene item order info structure.
Specifies the group this scene item belongs to, or NULL if none.
Specifies the scene item.
item_add (ptr scene, ptr item)
Called when a scene item has been added to the scene.
item_remove (ptr scene, ptr item)
Called when a scene item has been removed from the scene.
reorder (ptr scene)
Called when scene items have been reordered 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.
item_locked (ptr scene, ptr item, bool locked)
Called when a scene item has been locked or unlocked.
item_select (ptr scene, ptr item)
item_deselect (ptr scene, ptr item)
Called when a scene item has been selected/deselected.
(Author’s note: These should be replaced)
item_transform (ptr scene, ptr item)
Called when a scene item’s transform has changed.
name – Name of the scene source. If it’s not unique, it will be made unique
A reference to a scene
name – Name of the scene source. Does not have to be unique, or can be NULL
A reference to a private scene
Duplicates a scene. When a scene is duplicated, its sources can be just referenced, or fully duplicated.
name – Name of the new scene source
type –
A reference to a new scene
Returns an incremented reference if still valid, otherwise returns
NULL. Release with obs_scene_release().
Releases a reference to a scene.
A new scene item for a source within a scene. Does not increment the reference
The scene’s source. Does not increment the reference
The scene context, or NULL if not a scene. Does not increase the reference
name – The name of the source to find
The scene item if found, otherwise NULL if not found
Same as obs_scene_find_source, but also searches groups within the scene.
name – The name of the source to find
The scene item if found, otherwise NULL if not found
id – The unique numeric identifier of the scene item
The scene item if found, otherwise NULL if not found
Enumerates scene items within a scene in order of the bottommost scene item to the topmost scene item.
Callback function returns true to continue enumeration, or false to end enumeration.
Use obs_sceneitem_addref() if you want to retain a
reference after obs_scene_enum_items finishes.
For scripting, use obs_scene_enum_items().
Reorders items within a scene.
Reorders items within a scene with groups and group sub-items.
Releases all sources from a scene that have been marked as removed by obs_source_remove.
Adds/releases a reference to a scene item.
Removes the scene item from the scene.
The scene associated with the scene item. Does not increment the reference
The source associated with the scene item. Does not increment the reference
Sets the unique numeric identifier of the sceneitem. This is dangerous function and should not normally be used. It can cause errors within obs.
Gets the numeric identifier of the sceneitem.
Gets the unique numeric identifier of the scene item.
Saves all the transformation states for the sceneitems in scene. When all_items is false, it will only save selected items
Data containing transformation states for all* sceneitems in scene
Sets/gets the position of a scene item.
Sets/gets the rotation of a scene item.
Sets/gets the scaling of the scene item.
Sets/gets the alignment of the scene item relative to its position.
alignment –
Changes the scene item’s order relative to the other scene items within the scene.
movement –
Changes the sceneitem’s order index.
Gets position of sceneitem in its scene.
Sets/gets the bounding box type of a scene item. Bounding boxes are used to stretch/position the source relative to a specific bounding box of a specific size.
type –
Sets/gets the alignment of the source within the bounding box.
alignment –
Sets/gets the bounding box width/height of the scene item.
Sets/gets the transform information of the scene item. This version of the function also sets the crop_to_bounds member of obs_transform_info.
Added in version 30.1.
Gets the transform matrix of the scene item used for drawing the source.
Gets the transform matrix of the scene item used for the bounding box or edges of the scene item.
Sets/gets the selection state of the scene item. Note that toggling the selected state will not affect the selected state of other scene items, as multiple scene items can be selected.
Sets/gets the visibility state of the scene item.
Sets/gets the locked/unlocked state of the scene item.
Sets/gets the cropping of the scene item.
Sets/gets the scale filter used for the scene item.
filter –
Sets/gets the blending method used for the scene item.
method –
Sets/gets the blending mode used for the scene item.
type –
Allows the ability to call any one of the transform functions without updating the internal matrices until obs_sceneitem_defer_update_end has been called.
An incremented reference to the private settings of the
scene item. Allows the front-end to set custom information
which is saved with the scene item. Release with
obs_data_release().
Sets a transition for showing or hiding a scene item.
item – The target scene item
show – If true, this will set the show transition. If false, this will set the hide transition.
transition – The transition to set. Pass NULL to remove the transition.
item – The target scene item
show – If true, this will return the show transition. If false, this will return the hide transition.
The transition for showing or hiding a scene item. NULL if no transition is set.
Sets the transition duration for showing or hiding a scene item.
item – The target scene item
show – If true, this will set the duration of the show transition. If false, this will set the duration of the hide transition.
duration_ms – The transition duration in milliseconds
Gets the transition duration for showing or hiding a scene item.
item – The target scene item
show – If true, this will return the duration of the show transition. If false, this will return the duration of the hide transition.
The transition duration in milliseconds
Start the transition for showing or hiding a scene item.
Adds a group with the specified name. Does not signal the scene with the refresh signal.
scene – Scene to add the group to
name – Name of the group
The new group’s scene item
Adds a group with the specified name.
scene – Scene to add the group to
name – Name of the group
signal – If true, signals the scene with the refresh signal
The new group’s scene item
Creates a group out of the specified scene items. The group will be inserted at the top scene item. Does not signal the scene with the refresh signal.
scene – Scene to add the group to
name – Name of the group
items – Array of scene items to put in a group
count – Number of scene items in the array
The new group’s scene item
Creates a group out of the specified scene items. The group will be inserted at the top scene item. Does not signal a refresh.
scene – Scene to add the group to
name – Name of the group
items – Array of scene items to put in a group
count – Number of scene items in the array
signal – If true, signals the scene with the refresh signal
The new group’s scene item
Finds a group within a scene by its name.
scene – Scene to find the group within
name – The name of the group to find
The group scene item, or NULL if not found
The group context, or NULL if not a group. Does not increase the reference
The context for the source, regardless of if it is a group or a scene. NULL if neither. Does not increase the reference
item – Scene item
true if scene item is a group, false otherwise
group – Group scene item
Scene of the group, or NULL if not a group
Ungroups the specified group. Scene items within the group will be placed where the group was. Does not signal the scene with the refresh signal.
Ungroups the specified group. Scene items within the group will be placed where the group was.
group – Group scene item
signal – If true, signals the scene with the refresh signal
Adds a scene item to a group.
Removes a scene item from a group. The item will be placed before the group in the main scene.
Returns the parent group of a scene item.
scene – Scene to find the group within
item – Scene item to get the group of
The parent group of the scene item, or NULL if not in a group
Enumerates scene items within a group.
Callback function returns true to continue enumeration, or false to end enumeration.
Use obs_sceneitem_addref() if you want to retain a
reference after obs_sceneitem_group_enum_items finishes.
Allows the ability to call any one of the transform functions on scene items within a group without updating the internal matrices of the group until obs_sceneitem_defer_group_resize_end has been called.
This is necessary if the user is resizing items while they are within a group, as the group’s transform will automatically update its transform every frame otherwise.