Max Patcher Window GUI Update

Percy DaWulffe's icon

One button panning and centered document origin point

I'm looking to make Max's UI behave in a similar way to a program like Blender or Affinity Designer.

I want to:

1) Reassign the panning function to MMB (Middle Mouse Button) without the need of modifier keys. As it is now, Max reads the Middle Mouse Button input as the Left Mouse Button.

2) As for the second adjustment I want to make, I don’t quite know what to call it. Perhaps one of these will work:
Adjust the resolution of the canvas?
Make an infinite scrolling patcher window?
Make an infinite panning patcher window?

In any event, this is the issue, right now, 0,0 in the world space is located at the top left corner of the Max patcher window as shown here:

Patcher window world space origin.

I would like to change it so that 0,0 is located in the center of the window instead and subsequent panning and scrolling will continue infinitely in either direction.

Here is an example of what I mean.

If you notice, Blender's node window has no hard edge. There is no top or bottom, no left or right. The page doesn't wrap around on itself either. I do not know how this seemingly limitless workspace is achieved but they are open source so the code is stealable. Like Max, Blender is written in C, as well as C++ and Python.

Here is the code as well as some documentation for the feature in question:

The file structure can be found here: https://wiki.blender.org/wiki/Source/File_Structure

I'm not very experienced, so I may get things wrong, but:
Simplifying it, there's a list of nodes, which all have their positions, sizes, etc. These positions tell the location in "local space"(iirc), eg. not taking into account any zooming or pannning of the viewport. Before you draw the nodes, you set a view matrix based on the zoom and pan of the view. This is done here https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_node/node_draw.cc$2215 and here https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/space_node/node_draw.cc$2265 Oversimplifying again, but the view matrix tells the GPU how to offset every drawn shape from local space based on the zoom and pan of the view. Each draw after the view matrix has been set gets that offset.
After that is set, Blender goes though each node from that list and draws them (The coordinates passed in to the drawing functions are local space coordinates, as again, after the view matrix has been set, everything gets the correct offset).

Hopefully there is a way to acheive this in Max?

Ive tried poking around in ```/Appications/Max.app/Contents/Resources/C74``` but haven’t found what to edit to make this happen.

Hopefully this isn’t too much information.
Please let me know if anything is unclear.

Thanks for reading! 😊

Roman Thilenius's icon


for your "infinite panning patcher window" all you need is to use the [thispatcher] commands for size and position of a window... after you have put the window in panel style mode (no borders)

in opposite to a normal patcher window you will be able to move it in all directions - simply by not starting at 0/0 but somewhere in the middle of a 100,000*80,000 pixels window.

on a 2021 computer you can use ease functions or similar, then it will look like in VCV rack. :)
if you think it flickers too much, then use every other pixel, or every fifth.
on my older machines i only "scroll" half the screen size wise using keyboard commands, beause the drawing of some of my graphics objects takes ages.

Percy DaWulffe's icon

Wow thank you for the response!

I was not ready for that
What is panel style mode?
Also is there a message for the origin point?

Thanks again!

Roman Thilenius's icon


dont know offhand now, it is something like "window position 0 0 300 500, window exec"

look into the helpfile for [thispatcher] for the exact command, there is a message for setting origin and size values.

i prefer absolute values, so i made myself a little patch where i can enter left/top and bottom /right.

"panel" and "palette" is 110 language based on mac os classic gui terms. :)

the palette is the "float" style in thispatcher, the panel is when you set "nogrow" and "notitle" to a window, as that removes any visible border (in case your OS supports such a style - i´ve yet to try it win 10)

take care not to hit the "constrain" boxes in the helpfile, they will make it difficult to learn about sizing a window. :)

oh and and of course this does not work in max 5 - max 7.0, because you want to hide the sidebars in such a window ... patcher inspector (click contextmenu in background), "unpin on load" for all 4. from v7.1 on it should work (again, like in max v4)