miauu's Mini Transform Type-In

4 votes
Version: 
1.2
Date Updated: 
09/01/2017

  Script for 3dsMax 2009+ that changes the default Transform Type-In dialog to mini TTI. The miniTTI is placed over the title bar of the default TTI. The script file can be placed in maxroot/scripts/startup folder so when you run 3dsMax the default TTI will be automatically transformed to mini TTI and will be placed at the last used position of the TTI(default and mini).

In the video you can see how to use the script.

Special thanks to Denis Trofimov for his help.

Version Requirement: 
3dsMax 2009+
Video URL: 
AttachmentSize
miauuminitti_startup_10.ms6.44 KB
macro_miauuminitti_secondruncloseui.mcr6.71 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vikirecon's picture

thanks

hi Miauu,

thank you so so so much.

you are my superstar

thanks

miauu's picture

.

(
	--FUNCTIONS
	fn createAssembly =
	(
		str="using System;\n"
		str+="using System.Runtime.InteropServices;\n"
		str+="namespace Win32Helper\n"
		str+="{\n"
		str+=" class Win32HelperClass\n"
		str+=" {\n"
		str+=" [DllImport(\"user32.dll\")]\n"
		str+=" [return: MarshalAs(UnmanagedType.Bool)]\n"
		str+=" public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);\n"
		str+=" [DllImport(\"user32.dll\")]\n"
		str+=" public static extern IntPtr SetFocus(IntPtr hWnd);\n"
		str+=" }\n"
		str+="}\n"
 
		local csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
		local compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
		compilerParams.ReferencedAssemblies.addRange #("System.dll")
		compilerParams.GenerateInMemory = on
		local compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(str)
 
		for er = 0 to compilerResults.errors.count-1 do print (compilerResults.errors.item[er].tostring())
		return compilerResults.CompiledAssembly.createInstance "Win32Helper.Win32HelperClass"
	)
 
	local win32Helper = createAssembly()
 
	fn verifyTransformCommandMode =
	(
		local validCommandModes = #(#move, #Rotate, #scale, #nuscale, #uscale, #squash)
		if findItem validCommandModes toolmode.commandMode == 0 do
		(
			toolMode.commandMode = #move
		)
	)
 
	fn getInputString =
	(
 
		/*case toolMode.commandMode of
		(
		#Rotate: (str += "{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")
		default: (str += "{TAB}{TAB}{TAB}{TAB}")
		)*/
		local tabs = case toolMode.axisConstraints of
		(
		#x:4
		#y:5
		#z:6
		#xy:4
		#yz:5
		#zx:4
		)
		local str = ""
		for i = 1 to tabs do str += "{TAB}"
		str
	)
 
	fn showTTI =
	(
		max tti
		local hWnd = (for w in windows.GetChildrenHwnd 0 parent:#max where w[4] == "#32770" and \
		matchPattern w[5] pattern:"*ransform Type-In" collect w[1])[1]
		local hWndIntPtr = dotNetObject "System.IntPtr" hWnd
		local pos = mouse.screenPos
		win32Helper.setWindowPos hWndIntPtr 0 pos[1] pos[2] 0 0 1
		win32Helper.SetFocus hWndIntPtr
		(dotnetClass "SendKeys").sendWait (getInputString())
	)
 
	on execute do
	(
		verifyTransformCommandMode()
		hwndMove = (for w in windows.GetChildrenHwnd 0 parent:#max where w[4] == "#32770" and matchPattern w[5] pattern:"*ransform Type-In" collect w[1])
		if hwndMove[1] == undefined then
			showTTI()
		else
			windows.sendMessage hwndMove[1] 0x0010 0 0
	)
)
vikirecon's picture

close the dialogue box with the same shortcut key

hi miauu

thanks for the newer version

Could you Please do this for this script

thanks for your time again

this is the script

(
--FUNCTIONS
fn createAssembly =
(
str="using System;\n"
str+="using System.Runtime.InteropServices;\n"
str+="namespace Win32Helper\n"
str+="{\n"
str+=" class Win32HelperClass\n"
str+=" {\n"
str+=" [DllImport(\"user32.dll\")]\n"
str+=" [return: MarshalAs(UnmanagedType.Bool)]\n"
str+=" public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);\n"
str+=" [DllImport(\"user32.dll\")]\n"
str+=" public static extern IntPtr SetFocus(IntPtr hWnd);\n"
str+=" }\n"
str+="}\n"

local csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
local compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
compilerParams.ReferencedAssemblies.addRange #("System.dll")
compilerParams.GenerateInMemory = on
local compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(str)

for er = 0 to compilerResults.errors.count-1 do print (compilerResults.errors.item[er].tostring())
return compilerResults.CompiledAssembly.createInstance "Win32Helper.Win32HelperClass"
)

local win32Helper = createAssembly()

fn verifyTransformCommandMode =
(
local validCommandModes = #(#move, #Rotate, #scale, #nuscale, #uscale, #squash)
if findItem validCommandModes toolmode.commandMode == 0 do
(
toolMode.commandMode = #move
)
)

fn getInputString =
(

/*case toolMode.commandMode of
(
#Rotate: (str += "{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")
default: (str += "{TAB}{TAB}{TAB}{TAB}")
)*/
local tabs = case toolMode.axisConstraints of
(
#x:4
#y:5
#z:6
#xy:4
#yz:5
#zx:4
)
local str = ""
for i = 1 to tabs do str += "{TAB}"
str
)

fn showTTI =
(
max tti
local hWnd = (for w in windows.GetChildrenHwnd 0 parent:#max where w[4] == "#32770" and \
matchPattern w[5] pattern:"*ransform Type-In" collect w[1])[1]
local hWndIntPtr = dotNetObject "System.IntPtr" hWnd
local pos = mouse.screenPos
win32Helper.setWindowPos hWndIntPtr 0 pos[1] pos[2] 0 0 1
win32Helper.SetFocus hWndIntPtr
(dotnetClass "SendKeys").sendWait (getInputString())
)

on execute do
(
verifyTransformCommandMode()
showTTI()
)
)

vikirecon's picture

close the dialogue box with the same shortcut key

hi miauu

thanks for the newer version

Could you Please do this for this script

thanks for your time again

this is the script

(
--FUNCTIONS
fn createAssembly =
(
str="using System;\n"
str+="using System.Runtime.InteropServices;\n"
str+="namespace Win32Helper\n"
str+="{\n"
str+=" class Win32HelperClass\n"
str+=" {\n"
str+=" [DllImport(\"user32.dll\")]\n"
str+=" [return: MarshalAs(UnmanagedType.Bool)]\n"
str+=" public static extern bool SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);\n"
str+=" [DllImport(\"user32.dll\")]\n"
str+=" public static extern IntPtr SetFocus(IntPtr hWnd);\n"
str+=" }\n"
str+="}\n"

local csharpProvider = dotnetobject "Microsoft.CSharp.CSharpCodeProvider"
local compilerParams = dotnetobject "System.CodeDom.Compiler.CompilerParameters"
compilerParams.ReferencedAssemblies.addRange #("System.dll")
compilerParams.GenerateInMemory = on
local compilerResults = csharpProvider.CompileAssemblyFromSource compilerParams #(str)

for er = 0 to compilerResults.errors.count-1 do print (compilerResults.errors.item[er].tostring())
return compilerResults.CompiledAssembly.createInstance "Win32Helper.Win32HelperClass"
)

local win32Helper = createAssembly()

fn verifyTransformCommandMode =
(
local validCommandModes = #(#move, #Rotate, #scale, #nuscale, #uscale, #squash)
if findItem validCommandModes toolmode.commandMode == 0 do
(
toolMode.commandMode = #move
)
)

fn getInputString =
(

/*case toolMode.commandMode of
(
#Rotate: (str += "{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")
default: (str += "{TAB}{TAB}{TAB}{TAB}")
)*/
local tabs = case toolMode.axisConstraints of
(
#x:4
#y:5
#z:6
#xy:4
#yz:5
#zx:4
)
local str = ""
for i = 1 to tabs do str += "{TAB}"
str
)

fn showTTI =
(
max tti
local hWnd = (for w in windows.GetChildrenHwnd 0 parent:#max where w[4] == "#32770" and \
matchPattern w[5] pattern:"*ransform Type-In" collect w[1])[1]
local hWndIntPtr = dotNetObject "System.IntPtr" hWnd
local pos = mouse.screenPos
win32Helper.setWindowPos hWndIntPtr 0 pos[1] pos[2] 0 0 1
win32Helper.SetFocus hWndIntPtr
(dotnetClass "SendKeys").sendWait (getInputString())
)

on execute do
(
verifyTransformCommandMode()
showTTI()
)
)

miauu's picture

.

Try the version _SecondRunCloseUI.

vikirecon's picture

close the dialogue box with the same shortcut key

hi miauu

thnks for the nice script it would be better if i can close the dialogue box after pressing the same hotkey not th close button

appreciate your work i will be highly obliged if you do this beacause we use this extensively

thanks

viki

caogaiyu's picture

just a small tips

if you don't like the position of the miniTTI and also don't want to reset 3dsMax you could press F12 if you haven't change the hotkey for F12. It will give you the default TTI.
it works on 3dsMax2015

3dwannab's picture

Bump

Would it be possible to have a fix for this. Sorry. It always catches me out tabbing. (I go backwards) :P

miauu's picture

.

Watch the video carefuly. When the default TTI is shown move it and run the script. The default TTI will be replaced by the miniTTI. If you don\t like the position of the miniTTI reset 3dsMax and make default TTI visible. Move the TTI again and run the script. Repete the steps until the miniTTI is on the right place.

ostia's picture

nice but

an immovable pop window on max center lol
how to get move?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.