Detecting the active viewport to automate snap settings in MaxScript

Detecting the active viewport to automate snap settings in MaxScript

maxspeed_dev
Explorer Explorer
111 Views
2 Replies
Message 1 of 3

Detecting the active viewport to automate snap settings in MaxScript

maxspeed_dev
Explorer
Explorer

I've been experimenting with automating snap behavior in 3ds Max based on the active viewport, so I don't have to manually flip between Vertex, Edge, 2.5D, and 3D snap modes every time I switch viewports.

 

I'm curious how others approach this. Is there a reliable way you've found to detect the active viewport and switch snap settings accordingly, without interfering with the user's existing configuration?

 

Particularly interested in solutions that work reliably across 3ds Max 2020 through 2026.

0 Likes
112 Views
2 Replies
Replies (2)
Message 2 of 3

A娘
Advocate
Advocate

if you had ensure how to change settings with different viewport , add a callbacks with #activeViewportChanged , with viewport interface you can get the type , then set what you want
if you want a toggle between auto set and original , add a check button on a rollout , when checked , save current settings add the callbacks , when uncheck , remove callbacks and set with saved
if you only want some of types , then when active viewport not need , set with saved

Message 3 of 3

maxspeed_dev
Explorer
Explorer

Thanks a lot for the detailed answer! I actually ended up using #activeViewportChanged for this exact thing, so good to know that's the right approach. Really appreciate the tip on toggling with a rollout checkbox too, that's a nice pattern.

0 Likes