Layer helpers
| Function | Returns | Description |
|---|---|---|
GetLayerForScene(scene, name) |
Layer |
Returns the named layer within the given scene, or null if the layer does not exist. |
GetLayerByName(sceneName, layerName) |
Layer |
Looks up a layer by scene name and layer name. Returns null if the scene or layer is missing. |
LayerHasInputNamed(layer, sourceName) |
bool |
Returns true if the layer's current input has the given name. |
GetLayerTransformByName(sceneName, layerName) |
LayerTransform |
Returns the LayerTransform of the named layer in the named scene, or null if either lookup fails. |
GetLayerOperatorByName(sceneName, layerName, operatorName) |
object |
Returns the named operator within the named layer of the named scene, or null if any lookup fails. |
SetLayerSource(layer, sourceName) |
bool |
Assigns a named input as the source of the given layer. Returns false if the layer is null, the source name is empty, or no input matches the name. |
GetLayerTransformByName(scene, name) |
LayerTransform |
Returns the LayerTransform of the named layer within the given scene, or null if the layer is missing. |
ShowLayerByName(sceneName, layerName) |
bool |
Sets IsVisible to true on the named layer. Returns false if the scene or layer is missing. |
HideLayerByName(sceneName, layerName) |
bool |
Sets IsVisible to false on the named layer. Returns false if the scene or layer is missing. |
SetLayerOpacityByName(sceneName, layerName, opacity) |
bool |
Sets the opacity of the named layer's LayerTransform. Returns false if the scene or layer is missing. |
SetLayerRotationByName(sceneName, layerName, rotation) |
bool |
Sets the rotation of the named layer's LayerTransform. Returns false if the scene or layer is missing. |
SetLayerPositionXByName(sceneName, layerName, positionX) |
bool |
Sets the X position of the named layer's LayerTransform. Returns false if the scene or layer is missing. |
SetLayerPositionYByName(sceneName, layerName, positionY) |
bool |
Sets the Y position of the named layer's LayerTransform. Returns false if the scene or layer is missing. |
ExecuteOperatorCommand(selectedOperator, buttonName) |
bool |
Executes a named Command button on the given AbstractOperator, using reflection. Returns true only if the command was found and executed successfully. |
ExecuteInteractiveCommand(layer) |
bool |
Invokes the JS OnClick function configured on the layer's Button input. Returns false (and logs an error) if the layer's input is not a button. |
SetLayerAudioLevelByName(sceneName, layerName, volume) |
bool |
Sets the linear audio gain (left, right, and stereo) on the named layer. Returns false if the scene or layer is missing. |
SetLayerAudioLeveldBByName(sceneName, layerName, volume) |
bool |
Sets the stereo audio gain (in dB) on the named layer. Returns false if the scene or layer is missing. |
SwitchLayerSource(sceneName, layerName, sourceName) |
bool |
Replaces the input of the named layer with the named input. Scene, layer, and input names are all matched case-insensitively. Returns false if the layer or input is missing. |
GetOperatorObject(sceneName, layerName, operatorName) |
object |
Returns the named operator object on the named layer of the named scene. Returns false (boxed) if the scene or layer is missing; otherwise the operator object, or null if the operator does not exist. |
For multiple changes at once, prefer holding a LayerTransform reference and assigning fields directly:
var t = Project.GetLayerTransformByName("Scene", "Logo");
if (t != null) {
t.PositionX = 0;
t.PositionY = 0;
t.Opacity = 100;
t.Rotation = 0;
}