DeepAR Scripting API v5.6.15

Namespace: Interop

Interop

Collection of functions for interoperability between the effect(s) and the SDK framework.

Members

(static, readonly) currentEffectId :uint

The ID of the current effect where the script is running.
Type:
  • uint

(static, readonly) VarType :uint

Variable type.
Type:
  • uint
Properties:
Name Type Description
BOOL uint Boolean type.
INT uint Integer type.
DOUBLE uint Double type.
STRING uint String type.

Methods

(static) clearVars(effectIdopt) → {true|false}

Clear all variables or variables from the specified effect.
Parameters:
Name Type Attributes Default Description
effectId int <optional>
0 The ID of the effect in which to clear all the variables. Value 0 indicates that all the variables should be deleted.
Returns:
  • One or more variables are deleted.
    Type
    true
  • No variables are deleted.
    Type
    false

(static) deleteVar(name, effectIdopt) → {true|false}

Delete variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Returns:
  • Variable is deleted.
    Type
    true
  • Variable is not deleted.
    Type
    false

(static) getBoolVar(name, effectIdopt) → {boolean}

Get boolean variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Throws:
Variable with the given name does not exist or is not a boolean.
Type
Error
Returns:
Value of the variable with the specified name.
Type
boolean

(static) getDoubleVar(name, effectIdopt) → {double}

Get the double variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Throws:
Variable with the given name does not exist or is not a double.
Type
Error
Returns:
Value of the variable with the specified name.
Type
double

(static) getIntVar(name, effectIdopt) → {int}

Get int variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Throws:
Variable with the given name does not exist or is not an integer.
Type
Error
Returns:
Value of the variable with the specified name.
Type
int

(static) getStringVar(name, effectIdopt) → {string}

Get the string variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Throws:
Variable with the given name does not exist or is not a string.
Type
Error
Returns:
Value of the variable with the specified name.
Type
string

(static) getVarType(name, effectIdopt) → {Interop.VarType}

Get the type of the variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Throws:
Variable with the given does not exist.
Type
Error
Returns:
The variable type. Supported types are: boolean, int, double and string.
Type
Interop.VarType

(static) hasVar(name, effectIdopt) → {true|false}

Check if variable with the given name is already created.
Parameters:
Name Type Attributes Default Description
name string The variable name.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be searched in all effects.
Returns:
  • true The variable is already created.
    Type
    true
  • false the variable is not created.
    Type
    false

(static) setBoolVar(name, value, effectIdopt) → {true|false}

Set the boolean variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
value boolean Value to be set.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be set globally, for all the effects.
Returns:
  • The variable is created.
    Type
    true
  • The variable with the given name already exists and the new value is set.
    Type
    false

(static) setDoubleVar(name, value, effectIdopt) → {true|false}

Set the double variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
value double Value to be set.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be set globally, for all the effects.
Returns:
  • The variable is created.
    Type
    true
  • The variable with the given name already exists and the new value is set.
    Type
    false

(static) setIntVar(name, value, effectIdopt) → {true|false}

Set the int variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
value int Value to be set.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be set globally, for all the effects.
Returns:
  • The variable is created.
    Type
    true
  • The variable with the given name already exists and the new value is set.
    Type
    false

(static) setStringVar(name, value, effectIdopt) → {true|false}

Set the string variable with the given name.
Parameters:
Name Type Attributes Default Description
name string The variable name.
value string Value to be set.
effectId int <optional>
0 The ID of the effect in which to search the variable. Value 0 indicates that the variable should be set globally, for all the effects.
Returns:
  • The variable is created.
    Type
    true
  • The variable with the given name already exists and the new value is set.
    Type
    false