Method DuplicateAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
DuplicateAsync(ObsScene?, CancellationToken)
Makes a copy of the scene item, on top of the scene that the copy is made in, and returns the copy when the model shows it.
public Task<ObsSceneItem> DuplicateAsync(ObsScene? destination = null, CancellationToken cancellationToken = default)
Parameters
destinationObsSceneThe scene to make the copy in, or null for the scene that the scene item is in.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
- Task<ObsSceneItem>
The copy, which is in Items of the scene that it was made in.
Remarks
What OBS Studio 33.0.0 copies is the transform and the crop, and whether the scene item is shown; it does not copy whether it is locked, nor the blend mode (the copy is unlocked, and has the normal blend mode). It shows the same source: a copy is a scene item of its own, with an id of its own, and it is not another input.
OBS Studio 33.0.0 (obs-websocket 5.7.6) makes the copy in the scene of the original when the destination is given by its UUID alone: it reads the destination only when the request has its name. The model gives both (the UUID that is there is the one that finds the scene), and so does not depend on it. The plain client does: DuplicateSceneItem(SceneRef, int, SceneRef?, Guid?, CancellationToken) with a destination that is a UUID makes the copy in the scene of the original. See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.
Exceptions
- ArgumentException
destinationbelongs to another ObsModel.- ObsRemovedException
The scene item, its scene or the destination was removed.
- ObsNotConnectedException
There is no connection to OBS Studio. Nothing was changed.
- ObsNotReadyException
OBS Studio is changing its scene collection, or did so after the call. Nothing was changed.
- ObsUnknownOutcomeException
OBS Studio did not answer in time, or the connection ended: it is not known whether it made the copy.
- ObsNotConfirmedException
OBS Studio made the copy, and the model does not show it. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.