Bring a group of objects to the front


    Aug 01 2021 | 3:44 pm
    Hi, when I select multiple objects and do "bring to front" from the right-click menu, Max brings the objects to the front and preserves the inner z-order of the group of objects. How can I do the same in js ? If I "bring to front" every single object of the selection, I would need some knowledge about the z-order before.

    • Aug 02 2021 | 10:52 am
      No problem, the objects in the patcher are already sorted according to z-order. I can simply use this.patcher.apply(...)
    • Aug 02 2021 | 2:27 pm
      i understand the idea behind it but i guess in most cases the programmer can care about the order himself. see it positive: this then will also work with the traditional [thispatcher] method of background/foreground. ;)
    • Aug 02 2021 | 5:40 pm
      I finally have some time now for the moveable ui jsui (if you remember the thread some time ago) and I noticed it's helpful if the moved group of objects is brought to the front at the begin of the drag..
    • Aug 02 2021 | 6:17 pm
      i remember that and looking forward for a solution. though i personally wont go the jsui route so soon but mb the threadstarter will.
      what i find interesting is that when you copy and paste a bunch of objects into another patcher window, the relative z order between them remains intact - but they always end up over the existing objects. unlike in a layout program or html, if you know what i mean. maybe it should be generally available somewhere (not sure if the inspector would be the right place) so that nerds like us can control it programmatically.
    • Aug 02 2021 | 6:29 pm
      I think jsui has its right to exist, can do a lot of things that aren't possible otherwise. What is terrible is the inconsistency with bpatchers.