SelectionFirst()

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

説明

SelectionFirst 関数は、セレクションの最初のフィクスチャに関する整数セットを返します。これには、パッチ・インデックス番号と、Selection Grid 内の XYZ グリッド値が含まれます。

返される4つの整数をすべて使う必要はありませんが、それらは順番に返されます。

引数

この関数は、引数を受け取りません。

戻り値

  • integer:
    現在のセレクションの最初のフィクスチャのパッチ・インデックスを返します。これは、FID や CID ではありません。インデックスは 0 から始まります。
  • integer:
    Selection Grid のX軸上の現在位置を返します。Selection Grid は 0 から始まります。
  • integer:
    Selection Grid のY軸上の現在位置を返します。Selection Grid は 0 から始まります。
  • integer:
    Selection Grid のZ軸上の現在位置を返します。Selection Grid は 0 から始まります。

セレクションの最初フィクスチャについて返された数値を Command Line History に出力します。

Lua
return function()
    -- Store the return in a local variable
    local fixtureIndex, gridX, gridY, gridZ = SelectionFirst();
    -- Cancel the plugin if no fixture is selected
    assert(fixtureIndex,"Please select a fixture and try again.");
    -- Print the index number of the first fixture in the selection
    Printf("First selected fixture has index number: "..fixtureIndex
        .." and gridX value: "..gridX
        .." and gridY value: "..gridY
        .." and gridZ value: "..gridZ);
end

関連する関数