1. #1

    Default Is it possible to use a script to open and menu so a menu toggle can be made?

    Im trying to make a script that open a menu like tool but then another menu like brush if pressed again while open, I cant seem to get it to work.


    //ZBRUSH MACRO - Recorded in ZBrush version 4.73
    [IButton,???,"Press to run this macro. Macros can be aborted by pressing the ëescí key.",
    [IShowActions,1]
    [IConfig,4.73]
    [If,[IGet,Tool] == 1,
    [IPress,Brush]
    ,
    [IPress,Tool]
    ]
    ]

  2. #2

    Default

    I tried [IShowActions,1] or removing still wont show the action of bring up menu
    >.<

  3. #3
    Senior Member Follow User Gallery
    Join Date
    Aug 2011
    Location
    Mebane, NC
    Posts
    4,194

    Default

    Love the spacebar and hot keys for that.. Is this to be a part of something bigger?

  4. #4

    Default

    Yes, I have alot Menu/Custom menus on hotkeys and trying to save space/time by making based on how many times i click the hotkey

    example
    1ft Press = Tools Menu
    2nd Press = Brush Menu
    3rd Press = Alpha or Stroke Menu

  5. #5
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    You can use [IShow] to show a palette at the cursor position. If the palette is in the right or left tray then it will be opened there instead (or if it's already open, nothing will happen).

    This will cycle through three palettes as you press the hotkey. You could extend it to more palettes easily enough but make sure to use the loop otherwise it will just show the last palette (having quickly run through them all).

    [IButton,???,"Use hotkey to cycle palettes at cursor",
    [IShowActions,1]
    [IConfig,4.73]
    [If,[MemGetSize,Palette_Mem],,[MVarDef,Palette_Mem,1,0]]
    [Loop,1,
    [If,[MVarGet,Palette_Mem,0]==0,
    [IShow,Tool]
    [MVarSet,Palette_Mem,0,1]
    [LoopExit]
    ]
    [If,[MVarGet,Palette_Mem,0]==1,
    [IShow,Brush]
    [MVarSet,Palette_Mem,0,2]
    [LoopExit]
    ]
    [If,[MVarGet,Palette_Mem,0]==2,
    [IShow,Alpha]
    [MVarSet,Palette_Mem,0,0]
    [LoopExit]
    ]
    ]//end loop
    ]//end button




    A note about hotkeys with macro or plugin buttons: if your hotkey includes a modifier key such as SHIFT you need to repress it for repeat presses - it won't work if you hold it down and just press the other key. For example, if your hotkey is SHIFT+Q you'll need to press both keys each time.

  6. #6

    Default

    Thanks Marcus this works prefect your a life saver!

  7. #7
    Senior Member Follow User Gallery
    Join Date
    Dec 2016
    Location
    Germany
    Posts
    175

    Question

    Hi it sounds interesting... but could you explain it also a bit more to Scripting newbies, how it works, how it looks, what it is?

    Why I am asking: I'm looking for a better workflow - I would like to have a more intuitive control over the menues of subtools, geometry, polygroup, masking and so on.
    It's a terrible scrolling (which also means to have to leave the canvas) because they all are from the Tools palette and you never can have them all open at the same time.
    I also did not find a way to just grab the Subtools menue (only buttons can be customized as far as I know?) on the left side and any other menue from Tools on the right side (for example).

    Thanks,
    Alexx

  8. #8
    New Member Follow User Gallery
    Join Date
    Mar 2017
    Posts
    3

    Default

    I'm looking for the same thing! Would like to open sub palettes like split, merge, project, etc..

  9. #9
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    11,462

    Default

    All this does is show the main palettes at the cursor or in the trays. It's not possible to show a sub-palette in the same way. So, for example, it's not possible to script a way to have the SubTool palette pop-up at the cursor, or to isolate the SubTool palette from the main Tool palette. It's a real shame but it's just not possible.

    If you want to have more than one sub-palette open then you can Shift+click them when you open them. It's even possible to script this as I show in this thread but that's about the limit of what you can do.

  10. #10
    New Member Follow User Gallery
    Join Date
    Mar 2017
    Posts
    3

    Default

    @marcus_civis ahh that\s unfortunate. No worries though, I guess will just create a copy of whatever subpalette's I need and hotkey it that way. A little messy but should get the job done!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •