Table of Contents

Method SetTransitionOverrideAsync

Namespace
OBSStudioClient.Model
Assembly
OBSClient.dll

SetTransitionOverrideAsync(string?, TimeSpan?, CancellationToken)

Gives the scene a transition and a duration of its own, or takes them away, and returns when OBS Studio has made the change.

public Task SetTransitionOverrideAsync(string? transitionName, TimeSpan? duration = null, CancellationToken cancellationToken = default)

Parameters

transitionName string

The name of the transition to use for the scene (GetAllAsync(CancellationToken) lists them), or null to use the current one.

duration TimeSpan?

The duration to use for the scene, from 50 ms to 20 seconds, or null to use the one that is set for the transitions.

cancellationToken CancellationToken

A token that ends the wait. A change that was not sent yet is not sent.

Returns

Task

A task that completes when OBS Studio has answered that it made the change.

Remarks

Both null takes the override away. The two are independent: with only a duration the scene uses the current transition for that long (measured with OBS Studio 33.0.0). Nothing in the model shows the override, so the call has nothing to wait for but the answer of OBS Studio: ask what it holds with GetTransitionOverrideAsync(CancellationToken).

Exceptions

ArgumentOutOfRangeException

duration is less than 50 ms or more than 20 seconds. Nothing was sent.

ObsRemovedException

The scene was destroyed.

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 change.

ObsResponseException

OBS Studio refused the change: it has no transition of that name (ErrorCode is ResourceNotFound).