Show "Safe Frames" and "Live Area"


#1

I’m trying to find a Maxscript command to turn off the yellow “Live Area” lines around the “Safe Frame” area.

What does not work:
max safeframe toggle
displaySafeFrames = false

Both of these lose my correct display of the camera framing which is essential to the tool.

I’m doing a screen grab to the render size using Lone Robot’s wonderful function from http://forums.cgsociety.org/showthread.php?f=98&t=910941&highlight=preview, and when I use it with safe frame turned on, I get the yellow line around the safe frame.

I can manually turn this off by opening Viewport Configuration and turning off “Live Area” in the “Safe Frames” tab. This is not an acceptable solution for the tool (I’d prefer to render, but the client textures don’t have transparency set up correctly for a Max or MR render).

Any ideas?


#2

I’ve had some success using the DialogMonitorOPS to manipulate the viewport configuration and modify the statistics I prefer to display. A similar technique should get you what you need for Safe Frames.

(
	fn ConfigureCallback = 
	(
		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 
		)
		
		-- Uncheck the 'Live Area' checkbox
		for kidHWND in (UIAccessor.GetChildWindows hWND) where (UIAccessor.GetWindowText kidHWND) == "Live Area" do
		(
			UIAccessor.SendMessage kidHWND BM_SETCHECKED BM_UNCHECKED 0
		)
		
		UIAccessor.SendMessageID  hWND #IDOK

		true
	)

	DialogMonitorOPS.RegisterNotification ConfigureCallback id:#PokeViewportConfigure
	DialogMonitorOPS.Enabled = true		
	max vptconfig
	DialogMonitorOPS.unRegisterNotification id:#PokeViewportConfigure
	DialogMonitorOPS.Enabled = false
	ok
)


#3

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
 	)
 

#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.