- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, fellas.
I want to control Loft's Surface and Skin parameters.
Showproperties only dumps couple of useless things in my case.
Documentation is not much of a help either, unless I want to deal with SDK. And I don't because I can't.
Found a way to set checkboxes, not sure how clean or stable it is, but it works.
Spinners defeated me though.
Setting text to Edit field works, but doesn't stick. If I deselect Loft object and select it again, Length/Width Repeat values are reset.
Best I got is listed below. Idea was to set "fake" text and then "make it real" by clicking the SpinnerControl.
Value I set is treated as purely visual and is being overwritten by some internal value + increment from spinner click.
1.0 becomes 1.01 and not 10.01.
max2024
(
commandPanelHwnd = windows.getChildHWND #max "Command Panel"
local allControls = windows.getChildrenHWND commandPanelHwnd[1]
local WM_LBUTTONDOWN = 0x0201
local WM_LBUTTONUP = 0x0202
for ctrl in allControls do (
-- ctrl[1] HWND, ctrl[4] class, ctrl[5] text
if ctrl[5] == "Length Repeat:" then (
local parentHwnd = UIAccessor.GetParentWindow ctrl[1]
spinnerControls = (windows.getChildrenHWND parentHwnd)
for sctrl in spinnerControls do (
if sctrl[4] == "Edit" then (
UIAccessor.SetWindowText sctrl[1] "10"
)
if sctrl[4] == "SpinnerControl" then (
--format "%\t%\t%\n" sctrl[1] sctrl[4] sctrl[5]
windows.sendMessage sctrl[1] WM_LBUTTONDOWN 0 0
windows.sendMessage sctrl[1] WM_LBUTTONUP 0 0
)
)
)
)
)
Solved! Go to Solution.