Description
Description:
One of the many significant changes to the OBS websocket v5 protocol is that source visibility requires the source's ID within the scene where it is being enabled/disabled. For something as simple (and common) as toggling on/off a source, this is cumbersome and can add considerable complexity to client code. The "recommended" way of doing this is to use a batched request that get's a source's id within a scene (given the scene name and source name), store its value in the outputVariables
field of that request, then send a source enable request that specifies an inputVariable
from the prior request's outputVariables
as the sourceId
. (An example is given in the issue here: obsproject/obs-websocket#1014 (comment) ). Unfortunately, the typescript typedef for RequestBatchRequest
does not allow for the inputVariables
or outputVariables
fields.
Modifying the type.d.ts
file to allow for an optional inputVariables: any
and outputVariables: any
allows this to work via obs-websocket-js. However it appears that this file is automatically generated from OBS Websocket's types?
Versions Used (if applicable):
- obs-websocket-js version: 5.0.2
- obs-studio version: 28.1.2