ScriptSpot home

Change Viewport Statistic

Downloads

3ds Max compatibility
See original listing claims
Community compatibilityNo compatibility reports yet

No reports yet for the available releases.

Community reviewsNo reviews yet.

Listing details

Version
2
From original requirements
2009 or newer
Original version requirement
2009 and up
Author’s update date
Legacy votes
6
Listing created
How compatibility works

Compatibility comes from the author’s supported range or requirements in the original listing. A tested version records what the author tried.

“2020 unconfirmed” in the catalog means support for 3ds Max 2020 is still unknown.

Community reports record successful tests on specific releases.

Posted by

miauu

More by this author

Description

With this script you can change the Viewport Statistic fast and easy without going to the Viewport Configuration Dialog.

Script idea: Eric Chadwick

Videos
Comments (14)
3dwannab

I was trying to get this to work in max 2020. I've had no luck so far. What happens is the Viewport Config dialog comes up but stays up.

harumscarum

it is a button, but it brings me only statistics settings when statistics already ON
I need just simple button to toggle "Show Statistic in the Active View" option

max2020

.

I am not sure if I understand you correctly but the there is a shotrcut to toggle the "Show Statistic in the Active View" - the key "7"(not in NumPad).

harumscarum

cool idea - and have suggestion

would it be possible to make this script as button on toolbar to toggle statistics on/off

thanks

.

This is the way I use it. :)
Download and install xxx_v2.mcr. Then you can create a toolbar button.

3dwannab

I've made a little edit if you don't mind Miauu

I've edited your great code to turn on all stats with "Total + Selection" radio button enabled.
This has no UI, just run to show all stats and 'Total + Selection'.

--******************************************************************************************************
-- Created: 		22-03-2014   21:21h
-- Last Updated:	24-10-2016
-- Version:			2.00
--
-- Author :  Kostadin Kotev / miau_u@yahoo.com / http://miauumaxscript.blogspot.com/
-- Version:  3ds max 2009 (10) (should work in older versions too!)
--
/*
EDIT:  09-03-2018 3dwannab edit to turn on all stats and 'Total + Selection'.
Full credit goes to scripting master miauu (Kostadin Kotev) for the original code.

This has no UI, just run to show all stats and 'Total + Selection'.
*/
--
-- Discription: Changes the Viewport Statistics.
-- Usage: RUN IT
--
-- Idea: EricChadwick /http://ericchadwick.com//
--
--******************************************************************************************************
-- MODIFY THIS AT YOUR OWN RISK

(
	local curMaxVersion = ((maxversion())[1] / 1000)

	function ChangeStatistic =
	(
		dialogMonitorOPS.UnRegisterNotification id:#miauuChangeStatisticsSettingsID
		dialogMonitorOps.enabled = true
		function miauuChangeStatisticsSettings =
		(
			local BM_SETCHECK = 241
			local BN_CLICKED = 0
			local WM_COMMAND = 273
			local TCM_SETCURFOCUS = 0x1330
			--	""
			--	"max 2017"
			local statisticsTabIndex = if curMaxVersion < 19 and curMaxVersion > 14 then 6 else 5
			local hwnd = DialogMonitorOPS.GetWindowHandle()
			local hwnd_title = UIAccessor.GetWindowText hwnd
			if (hwnd_title == "Viewport Configuration") then
			(
				for kidHWND in (UIAccessor.GetChildWindows hWND) where ((UIAccessor.GetWindowClassName kidHWND) == "SysTabControl32") do
				(
					UIAccessor.SendMessage kidHWND TCM_SETCURFOCUS statisticsTabIndex 0
				)
				controls = windows.getChildrenHWND hwnd
				show = undefined
				for child in controls do
				(
					if (child[5] == type) do
					(
						show = child
					)
					-- for below 3 (radio btns) BM_SETCHECK must be set for each, change accordingly
					-- In this case "Total + Selection" is set to BM_SETCHECK 1 0
					if (child[5] == "Total") do (UIAccessor.SendMessage child[1] BM_SETCHECK 0 0)
					if (child[5] == "Selection") do (UIAccessor.SendMessage child[1] BM_SETCHECK 0 0)
					if (child[5] == "Total + Selection") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)

					if (child[5] == "Polygon Count") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)
					if (child[5] == "Triangle Count") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)
					if (child[5] == "Edge Count") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)
					if (child[5] == "Vertex Count") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)
					if (child[5] == "Frames Per Second") do (UIAccessor.SendMessage child[1] BM_SETCHECK 1 0)
				)
				if show != undefined do
				(
					UIAccessor.SendMessage show[1] BM_SETCHECK 1 0
					windows.sendMessage (UIAccessor.getParentWindow show[1]) WM_COMMAND ((bit.shift BN_CLICKED 16) + (UIAccessor.getWindowResourceID hwnd)) show[1]
					uiAccessor.sendMessageID hwnd #IDOK
				)
				UIAccessor.PressButtonByName hwnd "OK"
			)
			true
		)
		dialogMonitorOPS.RegisterNotification miauuChangeStatisticsSettings id:#miauuChangeStatisticsSettingsID
		max vptconfig
		dialogMonitorOPS.UnRegisterNotification id:#miauuChangeStatisticsSettingsID
		dialogMonitorOps.enabled = false
	)
	ChangeStatistic()
)
Kevin Merino

Thanks!

This helped me greatly in getting the viewports configured the way I needed them on batch routine that I am running!

Best Regards,
Kevin

Edward Snowden

Very nice little tool

Thanks for sharing this. Easy to customize startup default preset for each user. Great.

miauu

.

In version 2.0 the support for 3dsMax 2017 is added.

fedemas1969

Thanks for the script. In max 2016 seems that the "selection" buttton don't works, the others perfect.
thanks again.

er.cchadw.ck@gmail.com

This is fantastic, works very well. Thanks miauu!