This article explains how to use Lua scripting in PIXERA Control to interact with elements within Pixera and retrieve information from them.
Please see also:
Lua Basic Overview
pixc LUA Functions
API inside Control
The API within PIXERA Control is used to execute commands within PIXERA or retrieve data from PIXERA.
The structure of the API is always the same, regardless of whether it is in Control or via the external native TCP API. API - Quick Start Guide
Browse API commands
To find the API commands that can be used, search for them in Control in the Project tab or search the API tree.
Optional to this, you can browse them Online API Commands or inside the API Documentation delivered with the installation of PIXERA
API documentation files
Use of API Commands
To use those, you can follow the Tree leading to the command:
LUA Intellisense Options
This command will, as the name suggest, play the first Timeline inside Pixera.
In many cases, it can happen that you need to use return values of API commands. In many chases the return is a “handle”, this means that you can directly access those elements functions.
With the declaration of a variable like “tl” you can save the handle, or in this case table of handles inside the variable and use it later on:
local tl = Pixera.Timelines.getTimelines() --returns a table of handles
for i,tlElem in pairs(tl) do
tlElem.play()
end
This example code above will play every timeline in PIXERA, In this for loop applied to the table of handles, further commands can be executed directly on the element “tlElem”.
More specifically, all API commands can be applied in relation to a "Timeline".
This allows you to cascade through multiple objects and execute a wide variety of commands.
local tl = Pixera.Timelines.getTimelines()
for i,tlElem in pairs(tl) do -- iterate through all timelines
local ly = tlElem.getLayers() -- get all layers inside the timline
for i,lyElem in pairs(ly) do -- iterate through all layers
local node = lyElem.getNodeWithName("Position") -- get the node element "Position"
local param = node.getParamWithName("X") -- get the Param "X"
param.setValue(10) -- Set the value to 10
end
end
This code example above will set all X positions of all Layers in all Timelines to the value 10
PIXERA 25.1 | 28. July 2025 | J.B.