ZBrushCentral

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 hereand here

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 (414 Bytes)TranspToggle.txt (414 Bytes)

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,]

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?

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.

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.

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