Notifications
Clear all

[Closed] <Edit_Poly>.GetOperation() counterpart in Editable Poly?

Is there any way to find if an operation that brings up a dialog (basically any of those you can bring up with <EditablePoly>.PopupDialog <enum>popupOperation) is currently active in EditablePoly? In Edit Poly modifier, there’s the GetOperation method which is just perfect but I couldn’t find anything similar for EditablePoly. Thanks in advance.

18 Replies

Editable_Poly doesn’t store current operation in public place (Edit_Poly stores it in a parameter block).
Editable_Poly stores it in a static variable with PopupDlgProc object.
There is no way to get access to it.

so… using UIAccessor you can check all popup dialogs and find which window belongs to “epoly.dlo”

something:


for hwnd in uiaccessor.getpopupdialogs() do
(
	if filenamefrompath (uiaccessor.getwindowdllfilename hwnd) == "epoly.dlo" do
	(
		text = uiaccessor.getwindowtext hwnd
		format "hwnd:% text:%
" hwnd text
	)
)


But … there are stupid Caddy Controls. I have no idea what to do with them yet.

That’s ingenious and perfect for the task, never would have gotten the idea to use getwindowdllfilename for that! Thanks a lot.

Edit: ah, gotta hate the caddies not completely solved then…

Even just getting the caddies control takes too much time…

caddyHwnd = 0
ownerHwnd = UIAccessor.GetFirstChildWindow (windows.getMaxHWND())
for w in windows.getChildrenHwnd 0P while caddyHwnd == 0 where w[3] == ownerHwnd and w[4] == "Qt5QWindowToolSaveBits" do caddyHwnd = w[1]



I could probably make it much faster if I searched for the owned window in say C# (I suppose there’s no maxscript trick to get owned windows, right?), but that’s getting pretty complicated for a task like this…

you still can use GetPopupDialogs and check window type. For Caddies it’s QWidget

1 Reply
(@swordslayer)
Joined: 11 months ago

Posts: 0

Btw. this doesn’t apply in max 2018, the type is now Qt5QWindowToolSaveBits, GetPopupDialogs doesn’t collect it and different caddies elements are owned by a different Qt5QWindowIcon child of the main Qt5QWindowIcon.

the problem is that for max 2017+ it might be many other QWidgets, and how to find the epoly’s?

Yeah, plus there are also caddies for soft selection and it would be hard to differentiate them… Suddenly, checking if one of matching buttons in the editable poly rollouts is pressed doesn’t seem as crazy as it seemed when I started thinking about the ways to solve that…

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

i don’t get it… the buttons are not pressed after a dialog is opened. Do you want to monitor the pressing of buttons? How is about operations called with script for example?

what do you want to know? if any epoly operation is active or what operation is active?

Hmmm, you are right, script- or shortcut-triggered operations would be impossible to catch that way. I would like to know what operation is active.

Page 1 / 2