THANKS! That’s awesome.
I found another way to do this kind of "cropping" the yellow line in the paste bitmap line:
pasteBitmap VptDib FullViewcap (box2 LeftEdge 1 VptDib.width VptDib.height) [0,0]
Offsetting the LeftEdge seems to do it, though I wonder if it’ll work in all situations.
But the code you posted seems so generally useful I’m going to experiment with it to see what else I can do with it.
Edit: Wow, this really IS phenomenally useful. Some scenes have things like “Statistics” and “Viewport Clipping” turned on, as well as every possible “Safe Frames” option. A little modifying and I can automatically turn them off. I haven’t tried it yet, but it looks like this could be used for any interface in Max with a few changes, at least for anything involving a checkbox.
fn ConfigureCallbackFalse =
(
hWND = DialogMonitorOPS.GetWindowHandle()
if (UIAccessor.GetWindowText hWND) != "Viewport Configuration" do return true
TCM_SETCURFOCUS = 0x1330
BM_SETCHECKED = 0x00F1
BM_UNCHECKED = 0x0000
BM_CHECKED = 0x0001
-- Switch to the 'Safe Frames' Panel (it's number 2)
for kidHWND in (UIAccessor.GetChildWindows hWND) where ((UIAccessor.GetWindowClassName kidHWND) == "SysTabControl32") do
(
UIAccessor.SendMessage kidHWND TCM_SETCURFOCUS 2 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Live Area" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Action Safe" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Title Safe" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "User Safe" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Region (when Region Rendering)" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where ((UIAccessor.GetWindowClassName kidHWND) == "SysTabControl32") do
(
UIAccessor.SendMessage kidHWND TCM_SETCURFOCUS 5 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Show Statistics in Active View" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where ((UIAccessor.GetWindowClassName kidHWND) == "SysTabControl32") do
(
UIAccessor.SendMessage kidHWND TCM_SETCURFOCUS 0 0
)
for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Viewport Clipping" do
(
UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
)
UIAccessor.SendMessageID hWND #IDOK
true
)
fn cfgSafeActionFalse =
(
DialogMonitorOPS.RegisterNotification ConfigureCallbackFalse id:#PokeViewportConfigure
DialogMonitorOPS.Enabled = true
max vptconfig
DialogMonitorOPS.unRegisterNotification id:#PokeViewportConfigure
DialogMonitorOPS.Enabled = false
ok
)