Hey guys, me for one like to customize my UI to fit my need and as 'minimal' as possible. For instance, there is no necessary tools on Max's status panel that I really need to be on the whole time except the transform type-in. Yes I can use shortcut F12 to bring up the floater dialog, but honestly it looks ugly to have many floating thing above my viewport.
I have no experience in MAXScript before so what I did was just chop people code here and there and try to combine them together and make my own version of TTI, dockable version. Searched around the internet and seems like there is none that actually finished, the closest clue that I can get was
this but sadly it's not updated anymore, so I decided to mod it and this is what I've got so far;
rollout TFB "Transform Box" width:870 height:30
(
label Movelabel "Move" pos:[0,5] width:32
spinner spn1 "X" range: [-1e+008,1e+007,0] pos:[40,5] width:70
spinner spn2 "Y" range: [-1e+008,1e+007,0] pos:[120,5] width:70
spinner spn3 "Z" range: [-1e+008,1e+007,0] pos:[200,5] width:70
label Rotlabel "Rotate" pos:[285,5] width:32
spinner spn4 "X" range: [-1e+008,1e+007,0] pos:[330,5] width:70
spinner spn5 "Y" range: [-1e+008,1e+007,0] pos:[410,5] width:70
spinner spn6 "Z" range: [-1e+008,1e+007,0] pos:[490,5] width:70
label Scalelabel "Scale" pos:[575,5] width:32
spinner spn7 "X" range: [-1e+008,1e+007,0] pos:[620,5] width:70 scale:0.01
spinner spn8 "Y" range: [-1e+008,1e+007,0] pos:[700,5] width:70 scale:0.01
spinner spn9 "Z" range: [-1e+008,1e+007,0] pos:[780,5] width:70 scale:0.01
fn redefineTransformHandlers selection =
(
deleteAllChangeHandlers id:#typeInTransform
if selection.count == 0 do return()
if selection.count == 1 do
(
spn1.value = $.pos.x
spn2.value = $.pos.y
spn3.value = $.pos.z
spn4.value = $.rotation.x
spn5.value = $.rotation.y
spn6.value = $.rotation.z
when transform $ changes id:#typeInTransform handleAt:#redrawViews do
(
spn1.value = $.pos.x
spn2.value = $.pos.y
spn3.value = $.pos.z
spn4.value = $.rotation.x
spn5.value = $.rotation.y
spn6.value = $.rotation.z
)
)
)
on spn1 changed val do if selection.count == 1 do selection[1].pos.x = val
on spn2 changed val do if selection.count == 1 do selection[1].pos.y = val
on spn3 changed val do if selection.count == 1 do selection[1].pos.z = val
on spn4 changed val do if selection.count == 1 do selection[1].rotation.x = val
on spn5 changed val do if selection.count == 1 do selection[1].rotation.y = val
on spn6 changed val do if selection.count == 1 do selection[1].rotation.z = val
on TFB open do
(
callbacks.removescripts id:#typeInTransform
callbacks.addScript #selectionSetChanged "TFB.redefineTransformHandlers selection" id:#typeInTransform
)
on TFB close do
(
callbacks.removescripts id:#typeInTransform
)
)
createdialog TFB
cui.RegisterDialogBar TFB
cui.DockDialogBar TFB #cui_dock_bottom
The move is working fine, it even update the number when I select/ reselect/ select another object without any issue. But when continue on the rotation it's just stuck for some reason And apparently it limited the rotation on the spinner to be 1 to -1, instead of the full 360deg... Does anyone know what's the problem with the code I used on these? I'm guessing the
$.rotation.x/ y/ z is just wrong to use on that context (since it appear to be not in 'degree' value), but I can't find any alternative for accessing rotation through MAXScript.
Anyone, help?
Replies
What about scale then?
It appears that the display value on the spinner: 1, 2, 3 corresponded into 100%, 200%, 300% value on the standard tti box..hmmmm..
This should work. Think my max just bugged out
matchPattern "ASD BSD" pattern:"ASD*"
Actually there is so much more that I wanted to improve on this, one of them would be effecting the subobject selection, but probably that's for another time
Whoops sorry about that,found out the problem is #uscale stands for uniform scale and when I want to scale it non uniformly just add the #nuscale and it all works as expected
Hello guys I'm updating my Transform Box script but have a quick question; ..is there any particular reason why the above code didn't work for #uscale? when I mode my object it'll print "temp mv" or when rotate it'll print "temp rt" on the listener as expected, but when I scale the object, it didn't do anything..huh?
Here is what I've got so far; Hey miauu, if you got any idea how to improve this, feel free to post up, ok?
The most top point on my to-do list for this script is making it to work with sub-object mode.
PS: I do have a scipt to cycle between transform tool using a single hotkey, each press of a button on that other script will affect my TFB as well, like so; ..and another one to enter select mode; ..so it'll somewhat context sensitive and didn't take so much space on my custom UI
PPS: Ah, miauu on the other thread we're talking about mouse.buttonStates, can you try to press right mouse button and print the result after that?it seems like Max will stuck on the limbo of RMB being always held down (and this bugs also confirmed on the MXS help file, I believe....too bad )
when geometry $ changes
Open maxscript help file and read about WHEN COSNTRUCT.
Is is written in mxs help file mouse.buttonStates and the right mouse button are not a friends.
Linking custom spinners to the Tti spinners is not a problem. I thought about this after I post my previous post. I don't know if it will gives the same speed as when we use the Tti spinners, but it wil work with max9+. Tonight I will try to post a solution, if someone not post it before me.
In my next post is the final script.
The mini TTI can't be docked, but when the title bar and the borders are removed you can't move it, so place it in proper place and it will stay there.
Watch the video to see how to use the script. Tested on 3dsMax 2009 through 2015, Windows 7 and Windows 8.1.
Video demonstration.