Lua 関数の SelectionFirst は、セレクションの最初のフィクスチャに関する整数セットを返します。これには、パッチ・インデックス番号と、Selection Grid 内の XYZ グリッド値が含まれます。
返される4つの整数をすべて使う必要はありませんが、それらは順番に返されます。
この関数は、引数を受け取りません。
この例では、セレクションの最初フィクスチャについて返された数値を Command Line History に出力しています。
local function main()
-- Store the return in a local variable
local fixtureIndex, gridX, gridY, gridZ = SelectionFirst();
---- Uncomment the following lines to print the types of the return
-- Printf("Index type is: "..type(fixtureIndex));
-- Printf("gridX type is: "..type(gridX));
-- Printf("gridY type is: "..type(gridY));
-- Printf("gridZ type is: "..type(gridZ));
-- Cancel the plugin if no fixture is selected
assert(fixtureIndex,"Please select a fixture and try again.");
-- Print the index number of teh first fixture in teh selection
Printf("First selected fixture has index number: "..fixtureIndex
.." and gridX value: "..gridX
.." and gridY value: "..gridY
.." and gridZ value: "..gridZ);
end
return main