[Closed] Modifier Enable/Disable ModPanel redraw
So the problem with the .NET solution is that it’s only available in newer versions of max?
And the main problem of get+setCurrentObject pair is the flicker or is there something more?
So the problem with the .NET solution is that it’s only available in newer versions of max?
I didn’t use this solution before you showed. I send the notification with c++ sdk
And the main problem of get+setCurrentObject pair is the flicker or is there something more?
not just a flicker… it also changes sub-object level, modifier selection
Hmmm, I only tested in 2019 but subobject level definitely doesn’t change here (modifier selection does, if some other modifiers are selected other than the current one).
updating state of modifier (enable, name) is just a part of a bigger problem… another part is that these operations are not undoable. so I added mxs extension for it which is undoable and updatable
sub-object doesn’t change. you are right. i forgot or mixed it up with suspend/resume editing
i’ve double checked it again… if we reset current edit object as:
modpanel.setcurrentobject (modpanel.getcurrentobject())
for some modifiers it changes sub-object level to “object”… for example see Skin modifier
Besides the flickering (which can be avoided), if you are in a higher modifier selection, it may display the warning message (if is not turned off).
Do you find any drawbacks using postMessage()? here is nother attempt:
WM_RBUTTONDOWN = 0x0204
WM_KEYDOWN = 0x0100
ESCAPE = 0x1B
listbox_hwnd = /*0x00000000*/
windows.postmessage listbox_hwnd WM_RBUTTONDOWN 0 0
windows.postmessage listbox_hwnd WM_KEYDOWN ESCAPE 0
The only thing I could find is that it stops the animation if is playing.
just tested the last version. It works very well on my version (MAX 2016). The flickering is minimum
The only constant I can see from Max 2010 to 2019 is the Resource ID, but it could change in the future.
So something along this lines may work. Tested in Max 2010 to 2019 in “common” conditions. Not sure if there could be a setup that breaks it. If there is we could try to find another common value across all Max versions, or simply a different approach.
fn GetCommandPanelModifiersListBoxHWND =
(
id = 0x00000699
LBHWND
for j in uiaccessor.getpopupdialogs() do
(
for i in windows.getchildrenhwnd j where (uiaccessor.getwindowresourceid i[1]) == id do exit with LBHWND = i[1]
)
if LBHWND == undefined do
(
for j in windows.getchildrenhwnd #max where (uiaccessor.getwindowresourceid j[1]) == id do exit with LBHWND = j[1]
)
return LBHWND
)
good find! i think that resource ID is pretty safe and unique identifier. It’s always predefined and as we can see stays long time in the system. I think it’s the right way to find the list if we know the “task panel” hwnd (technically it’s a parent of “Command Panel”)