grandMA3 User Manual Publication
Children(handle)

grandMA3 User Manual » Plugins » Lua Functions - Object API » Children(handle)
Version 2.0

Description

The Children Lua function creates a table of handles of the children of an object.

Arguments

  • Handle:
    The function takes a handle of the type "light_userdata" as an argument. It can be omitted when using the colon notation on an object. See the example below.

Return

  • Table:
    The function returns a table with the child objects. If there are no children, then it returns an empty table.

Example

This example returns the name of the cues in the first sequence of the selected data pool:

Lua
return function()
-- Stores the handle for sequence 1 in a variable.
local mySequence = DataPool().Sequences[1]
-- Use the "Children()" funciton to store a table with all the children in a new variable.
local cues = mySequence:Children()
-- For loop that uses the length operator on the cue variable.
for i = 1, #cues do
-- Text is printed for each child.
Printf("Sequence 1 Child " .. i .. " = " .. cues[i].name)
end
end