[Closed] toggling CAT's 'manipulation causes stretching'
anyone has an idea how to toggle the ‘manipulation causes stretching’ check box in the hierarchy panel of CAT bones? There is no way to toggle it that is exposed to mxs.
We’ve tried to use UI access to do so but couldn’t find the right message.
fn setUICheckboxState hwnd state =
(
local BN_CLICKED = 0 -- clicky message ID
local BM_SETCHECK = 241 -- checkbutton toggle message ID
local WM_COMMAND = 273 -- windows command message
local parent = UIAccessor.getParentWindow hwnd
local id = UIAccessor.getWindowResourceID hwnd
windows.sendMessage hwnd BM_SETCHECK state 0
windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) hwnd
OK
)
--Catbone must be selected
fn setManipulationCausesStretching state =
(
max hierarchy mode
cmdPnlHwnd = windows.getChildHWND #max "Command Panel"
lockHwnd = windows.getChildHWND cmdPnlHwnd[1] "Lock Local Scale"
manipHwnd = uiaccessor.getNextWindow lockHwnd[1]
setUICheckboxState manipHwnd (if state then 1 else 0)
)
That particular control is a tricky one.
It is not a checkbox with text.
Because it is more than 1 line, they used a checkbox with no text, and next to it a label.
edit: Forgot to mention the setUICheckboxState function is not mine, I found it on a very old post in this forum. I can’t remember who the original author is, sorry.
Thanks man!
We’ve tried using your ‘window shopper’ tool (which is very cool) to figure this out but we got confused. Can you explain a bit how to do this for next time?
Yes, I also used Windowshopper to find the control:
- Navigate down the treeview until you get to this group of controls.
- When you press a control it should flash red on the screen, so I pressed the one after ‘Lock Local Scale” and saw only the checkbox flashing without the label.
-
The order of the subcontrols is always permanent, so it is safe to retrieve “Lock Local Scale” by name and then get one control after it using ‘uiaccessor.getNetxWindow’
-
some caveats:
If the command panel is not docked, it may be a child of the desktop and not of max. so if
windows.getChildHWND #max "Command Panel"
return undefined, you may need to get it using
windows.getChildHWND 0 "Command Panel"
or
windows.getChildHWND (windows.GetDesktopHwnd()) "Command Panel"
- localized versions of 3dsmax might fail as the names would be wrong.
Hi Rotem,
just poped in to say thanks!
This small checkbox annoyed the hell out of me for a couple of years now.
you da man
My pleasure, Aviv!
It’s a shame almost every tool has to rely in some way on UI manipulation, but what can you do