Children(handle)

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object API » Children(handle) Version 2.2

説明

Children 関数は、オブジェクトの子のハンドル・テーブルを作成します。

引数

  • handle:
    light_userdata 型のハンドルです。オブジェクトでコロン記法を用いる場合は省略できます。

戻り値

  • table:
    子オブジェクトのテーブルを返します。子がない場合は、空のテーブルを返します。

選択されているデータプールの最初のシーケンスにあるキューの名前を返します。

Lua
return function()
    -- Stores the handle for sequence 1 in a variable.
    local mySequence = DataPool().Sequences[1]
    if mySequence ~= nil then
            -- 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
    else
        ErrPrintf("Sequence could not be found.")
    end
end