1. #1

    Default Transparent Toggle script doesn't work on Hotkey

    I feel odd that I can't figure this out but I've never been much of a programmer. I'm making a Toggle for the Sub-Tool Transparency and so far I managed to meld a few scripts together to make the macro work. On/Off works great when clicking the macro button.

    Here's my problem. I set the hotkey to my tilde(`) and it will turn the transparency button on, however pressing it again will not execute the macro to turn the button off.

    My examples are from here and here

    Attachment 582298

  2. #2
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    10,852

    Default

    Something went wrong with your attachment so I can't say what the problem is with your code but here's an example macro to toggle the Transparent mode.


    [IButton,???,"Toggle Transparent mode",
    [IConfig,4.8]
    [If,[IsEnabled,Transform:Activate],//if there's a model in Edit mode so the button will work
    [If,[IGet,Transform:Activate] == 1,//the button will return 1 if it's on
    [IUnPress,Transform:Activate]
    ,//else it's off so turn it on
    [IPress,Transform:Activate]
    ]
    ]
    ]//end of macro



    TranspToggle.txt

  3. #3

    Default

    Oh hi, its you! Thanks for the help. I tried your macro and it works much like mine did but I can see there are some better variables in line. Unfortunately the same thing happens with your's too. When I assign a hotkey to the macro it will only toggle the transparency on but nothing else. Might this be a hotkey issue?

    Here's the code I used:

    [RoutineDef,TransparencyToggle,

    [If,[IGet,Transform:Activate] == 1,//the button will return 1 if it's on
    [IUnPress,Transform:Activate]
    ,//else it's off so turn it on
    [IPress,Transform:Activate]
    ]

    ]//Routine TransparencyToggle




    [IButton,???,"Toggles Transparency On and Off for Sub-Tools.",
    [IShowActions,0]
    [IConfig,4.8]


    //[IFreeze,
    [RoutineCall,TransparencyToggle]
    //]
    ,,1,,,]

  4. #4
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    10,852

    Default

    Hi,

    Are you using Shift, Ctrl or Alt with your hotkey? There's an issue with macros and plugins that you need to release the modifier key as well as the ordinary key for each hotkey press. Perhaps that is the effect you are seeing?

  5. #5

    Default

    No, just the tilde by itself. I use it as the transparency hotkey in Maya already so I am trying to sync my workflow some. I noticed something else as well, if I use the hotkey it works once, after that it never works again, even if re-assigned. The macro if pressed works, just not the hotkey.

  6. #6
    Moderator Follow User Gallery
    Join Date
    Jun 2004
    Location
    UK
    Posts
    10,852

    Default

    I think that the problem is using the tilde. That key is used for dragging the canvas in 2.5D wrap mode and is hard-coded into ZBrush. Assigning it as a hotkey to the macro doesn't work at all for me.

  7. #7

    Default

    That must be it, I got it working on another hotkey now. Thank you for your help Marcus!

Tags for this Thread

Posting Permissions

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