GetChannelFunctionIndex()

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

説明

GetChannelFunctionIndex 関数は、指定された2つのインデックス番号にマッチするチャンネル機能のインデックス番号を返します。

引数

戻り値

  • integer:
    チャンネル機能のインデックス番号を返します。

フィクスチャ・セレクションと Dimmer アトリビュートに基づいて、チャンネル機能のインデックスを出力します。

Lua
return function()
    -- Get the Attribute index and UIChannel index.
    local attributeIndex = GetAttributeIndex("Dimmer")
    local uiChannelIndex = GetUIChannelIndex(SelectionFirst(),attributeIndex)
    -- End the function if any of the index return nil.
    if (attributeIndex == nil or uiChannelIndex == nil) then
        ErrPrintf("Something wrong happened, maybe your first selected fixture don't have a Dimmer - Please try again")
        return
    end
    -- Get the Channel Function Index and store it in a variable.
    local channelFunctionIndex = GetChannelFunctionIndex(uiChannelIndex,attributeIndex)
    Printf("The UIChannel Index is: %i. The Attribute Index is: %i. The Channel Function Index is: %i", uiChannelIndex, attributeIndex, channelFunctionIndex)
end