Use [ThisPatcher] to get Presentation_Rect? or other ways to get presentation_rect without connecting directly to object?
I'm looking to perform a calculation on the presentation_rect of an object and then set the new presentation_rect based on the results of that calculation. I want to do this on LOTS of objects at once.
I know I can hook up a [getattr presenation_rect], send that into my calculator subpatch, and have that ouput a "presentation_rect $1 $2 $3 $4" message and feed that message back to the object. This works.
But if I want to do this on a lot of objects, I have to duplicate this assembly all over the place and hook it up to every single object. Then I have a button in the middle that goes to each of these to trigger the calculation, when it's time to move the objects.
It's a pain to set up, and ugly as hell to look at. These conditions have sent me searching for a better way.
[thispatcher] scripting seems like a good place to look. I can use the "sendbox" command to update the presentation_rect of the object. But is there any way to get the presentation_rect of an object with [thispatcher].
If I could script it, then I only have to create my calculation once. And when the time comes, I can just iterate through every object in a list and update each of their presentation_rects through [thispatcher]. This function can be a self-contained little section off to the side, and not require 3 or 4 objects and a bunch of patch chords for every single object in the patch.
The only thing stopping me is I don't know how to get the presentation_rect of the object without hooking up directly to it. Any thoughts?
A little bit of context:
I want to run a fullscreen patch that supports various screen resolutions / window sizes. So instead of using the absolute presentation_rect, I need to calculate the presentation_rect relative to the center of the screen based on the window size the user has selected. And I need to update these presentation_rects if the user changes the window size.
I made an assembly that will do it. But it has to plug directly into the object. So it's really ugly to use for every single object that appears in the presentation.
Any suggestions would be a big help! Thanks!
I would find equally useful your suggestion to query (or update) any attribute of a named object without having to connect patch coords.
In regard to your intent, do you wish to simply zoom the patch (scale the patch elements) or there's a different layout involved?
I am also looking for a mechanism to do this, and for basically the same reason.
Js in Max is predestined for such tasks. [thispatcher] cannot query attributes of objects.
Have you seen some older threads about this sort of need? Maybe it helps...