Notifications
Clear all

[Closed] Expand/Collapse SubTree in Modifiers Stack list

Any idea?

When I say “any” I mean every idea is welcome – max api, winapi, mxs (if I missed anything).
Thanks

12 Replies

if you can get the handle to the TreeView control it should be pretty simple from there… enumerate the child windows till you find what your looking for with

// given controlHwnd passed to me
TCHAR controlClassName[128];

GetClassName(controlHwnd,controlClassName,128);
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

the problem is – it’s not a treelist. it’s a custom control made from listbox (!!!). all messaging is custom and based on timer

What strange is that max saves the state of modifier’s subtree withing a scene, so there must be sort of a flag somewhere inside the modifier data or localData.
I compared the bytes of mod local data before and after subtree expansion, but nothing seem to change there. It is identical.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

max stores subtree states with scene as well. so it might be a scene data instead of a modifier data.

Wonder how could we locate that singe bit.

Ok… I have a progress.

  1. I can find the modifiers list HWND (the first ListBox of Command Panel)
  2. I can read all listbox items texts
  3. I can get listbox selection
  4. I can get any listbox item Rectangle
  5. I can “Left mouse Click” in any place of listbox including out of local rectangle

i have to click several units right from left of rectangle. It seams like 35 is a safe number for all versions (+/- icon)

all works… (i will show it later). I can expand/collapse subtree .

Now the problems:

  1. Is modifiers list always the first ListBox of CommandPanel children?
  2. Is 35 units safe shift to click at?
  3. How to get that the modifier expanded/collapsed? Here I have an idea – I know all modifiers names and all listbox items texts. I can find a gap (expanded) or no gap (collapsed). But… What if anyone named a modifier like “Vertex”, “Face”, etc. (using one of sub object names or a gizmo name)?

in Qt version of UI it’s an arrow icon. but it doesn’t matter. The icon in both versions is just custom drawn.

All this is a “hack” solution. I don’t like it, but don’t see better yet.

it’s not the first actually… it’s a second

edited… actually worse… it might be any depends on current object content.

But you also know the order in which modifiers are applied. So if the modifier is expanded then all its subobjtypes listitems should follow otherwise the next listitem is so strangely named modifier.
I mean you can’t have expanded edit_poly modifier listitem that follows with listitem named “Face”. It should be Vertex, Edge, Border etc…
I’m not sure if there’s anything similar to sdk baseobject’s NumSubObjTypes property and GetSubObjType
Using these could help you a lot with this.

good catch! every plugin has to provide this info.

edited

Yes! It works. Thanks.

Page 1 / 2