Home Technical Talk

Max Quad Menu selection

polycounter lvl 18
Offline / Send Message
Slum polycounter lvl 18
Here's an interesting one..

I'm wondering if there's a plugin/setting/script that allows me to see and select all scene objects using a quad menu. For example, you press the "H" key, you get a list of items and the ability to select them. In my dream scenario, you'd be able to just right click and see a list.

Working with particle simulations, you start to get a lot of objects built up, and it would save quite a bit on the workflow to be able to select items with one mouse click.

Replies

  • Rob Galanakis
    Not sure exactly what you mean... how would it differ from the select by name? Just be a much simpler interface (and happen at the mouse pointer location)?
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    Selecting by name requires me to make sure i'm not in a text box, press H, then click on the name from a list, then click on the "select" button. Since quad menus work on release of the mouse button, it would be much faster.
  • Rob Galanakis
    Here is a rough start:

    <font class="small">Code:</font><hr /><pre>macroScript quadMenuList
    (
    try (destroyDialog roll_mouseList) catch ()
    max select all
    allObjArr = selection as array
    allObjStrArr = #()
    for i in 1 to allObjArr.count do (
    append allObjStrArr allObjArr.name
    )

    rollout roll_mouseList "Falloff" --width:200 height:24
    (

    listbox li_allObj "Scene Objects" items:allObjStrArr

    on li_allObj doubleClicked sel do (
    objStr = li_allObj.items[sel]
    execute ("select $" + objStr)

    destroyDialog roll_mouseList
    )
    )

    createDialog roll_mouseList pos:(mouse.screenpos-[194,10]) style:#(#style_sysmenu)
    )
    </pre><hr />
    You can assign this macro to your quad menu.

    If you can be more particular about what you need to select, etc., I can refine it. Right now it selects everything visible in your scene for you to choose from, and you select whatever you doubleclick.
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    Thanks man, that's a nice start indeed. What I'm actually looking for is something that puts your selection items inside the quad menu, rather than opening a new listbox. Is that even possible, or am I just dreaming here?
  • Rob Galanakis
    Still not entirely sure what you mean... maybe a mock up of what you want the quad menu to look like? Have all objects appear on a quad in your quad menu so you can select them that way?

    Also, do you want all selected objects, objects of a particular type, etc?
  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    quadselectoo7.jpg

    here's a quick mockup. Ideally it would select objects of any type. Maybe only objects that are not hidden?
  • Rob Galanakis
    <font class="small">Code:</font><hr /><pre>
    macroScript quadMenuList
    (
    try (destroyDialog roll_mouseList) catch ()

    allObjArr = #()
    allObjStrArr = #()

    for i in objects do (
    if i.isHidden == false then append allObjArr i
    )

    for i in 1 to allObjArr.count do (
    append allObjStrArr allObjArr.name
    )

    if objects.count >= 1 then (
    rollout roll_mouseList "Falloff" --width:200 height:24
    (

    listbox li_allObj "Scene Objects" items:allObjStrArr height:allObjStrArr.count

    on li_allObj selected sel do (
    objStr = li_allObj.items[sel]
    execute ("selectMore $" + objStr)
    )

    on li_allObj doubleClicked sel do (
    objStr = li_allObj.items[sel]
    execute ("selectMore $" + objStr)

    destroyDialog roll_mouseList
    )
    )

    createDialog roll_mouseList pos:(mouse.screenpos - [10,10]) style:#(#style_sysmenu)
    )
    )
    </pre><hr />

    Unfortunately I can't do what you need, it would probably need some SDK implementation which I can't do. I doubt it is even doable with some dotnet stuff, probably needs true SDK love.

    I've cleaned up the code some and I think I'm going to start using it. It will put all visible objects (of all types) on the list to select. Each time you click you will add to the selection, doubleclick to select the last item and close the floater. I use a hotkey but it is of course fine to use on your quad menu.

    Any other improvements or suggestions, feel free to ask.
  • Noren
    Offline / Send Message
    Noren polycounter lvl 19
    Did you consider the selection floater ? Eats up screenspace, and you have to move your mouse of course. But updates and is always available.
  • Rob Galanakis
    I updated my last post with some code... now needs at least one scene object to launch, and the height of the list will adjust to how many objects you have in your scene.

    Selection floater is probably a better bet still though.
Sign In or Register to comment.