List all Fixture Ids

  • Hello,

    once again I ask for your help.

    I am trying to retrieve the list of all the identifiers of the fixtures that the user has selected in order to then apply different operations to their attributes (change color, position, ...) via lua plugin but I'm not sure I'm doing it right. Currently, for my tests, I have two fixture types:

    - Magic Panel (with sub-fixture) [FID 901 Thru 912]

    - MacQuantum [FID 101 Thru 110]

    The code I'm currently using is:

    You will notice that I use :GetClass() at Line 24 to exclude sub fixtures from magic panels. However, I'm not sure I'm doing it right.

    Let me explain :

    If I then want to loop over the fixtureIds and do not filter via :GetClass(), I end up with AND the fixtures' ids (101, 102, ...) AND the sub-fixtures's ids.

    However, for example, if I want to do MATricks afterwards, my selection could be distorted because I only want the Fixtures and not the sub fixtures (example: in the case where I want to do some positions).

    Do you have a solution ? It depends on what I want to do?

    My original idea was to go through the whole selection to find out which fixture or sub-fixture had the attributes I wanted via the GetAttributeIndex and GetUIChannelIndex ("Pan" & "Tilt" for this case).

    This is the way to achieve it ?

    I also tried using the pseudo code from the documentation:

    local subfixtureIndex = SelectionFirst(true);
        Printf("subfixture selected with index: "..subfixtureIndex)
        subfixtureIndex = SelectionNext(subfixtureIndex)
    until not subfixtureIndex;

    but I don't understand what these indexes correspond to. Is there anything that converts them to FID?

    Edited 2 times, last by mokaByls: additional informations (April 15, 2023 at 10:09 AM).

  • Thanks Andreas , this was my starting point to re-write my function !

    After a few hours, here the final version of my function. I written a little "plugin" who extract all FIDs of your selection who supports given attributes :

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!