Skip to content

API Reference

elgarf edited this page Feb 1, 2018 · 4 revisions

Here is internal UTC API reference for using within button widget scripts.

Expression functions

State access function

_('Path for variable') is state access function, using it you can get any value from vMix state. If button is not state dependent, you will get value from initial state, which is updated by pressing "Update State" button in UTC interface. Otherwise you get value from auto-updateable state, which is same for all state dependent buttons and updated every 5 or more seconds.

For example, if you want to get input title, you should use expression

_('Inputs[78520042-b6df-4aac-8c17-d3d7f056c24b].Title')

Where "78520042-b6df-4aac-8c17-d3d7f056c24b" is your title key. You can use mathematical expressions into value/index/condition fields of script commands.

String manipulation

split(string, separator) splits string into an array of strings by separating the string into substrings, using a specified separator string to determine where to make each split.

trim(string) removes whitespace from both ends of a string.

Array manipulation

getvalue(array, index) gets value from array at index index.

State properties

That's hierarcical list of properties, which you can get from vMix state.

  • Version
  • Preview
  • Active
  • FadeToBlack
  • Recording
  • External
  • Streaming
  • PlayList
  • MultiCorder
  • Inputs[]
    • Key
    • Number
    • Type
    • Title
    • InnerTitle
    • Position
    • Duration
    • SelectedIndex
    • Muted
    • Loop
    • MeterF1
    • MeterF2
    • Audiobusses
    • Elements[] (Depends on element type: text/overlay/position/image)
      • Type
      • Index
      • Text (for text element)
      • Key (for overlay element)
      • Elements[] (for overlay element, same as Inputs.Elements)
      • PanX (for position element)
      • PanY (for position element)
      • ZoomX (for position element)
      • ZoomY (for position element)
      • Image (for image element)
  • Overlays[]
    • Number
    • ActiveInput
  • Transitions[]
    • Number
    • Duration
    • Effect

Examples

  1. Getting Version property

_('Version')

  1. Getting some data from XAML title

_('Inputs[78520042-b6df-4aac-8c17-d3d7f056c24b].Elements[0].Text')

You can get element index from http://localhost:8088/API? link.

Where it can be useful

That's useful for making data-based scripts, for example you need set values for one title when some property equal one and for another title if it's equal zero. And so on. That's very powerful feature which can help automate your work.

Clone this wiki locally