ZBrushCentral

overwriting a texture?

so I’de like to do something like this to make a quick alpha hotkey.

[varSet, MyQuickAlphaName:[IPress,Texture:MakeAlpha]]

then later in my macro

[IPress,Alpha:#MyQuickAlphaName]

but it’s not showing up anymore when I make this change to the macro text file in zbrush. any pointers?

-b

Macros will fail to load if they contain errors. :slight_smile:

The problem with your code is that [IPress,Texture:MakeAlpha] doesn’t return the alpha it creates, so you can’t assign it to a variable.

Instead you need code like this:

[IPress,Texture:MakeAlpha]
[VarSet, MyQuickAlphaName, [IGetTitle,Alpha:Current Alpha]]

then later you need to use the variable like this:

[IPress,[StrMerge,“Alpha:”,#MyQuickAlphaName]]

EDIT: Note that your variable will only store the name of the alpha so long as the macro is active. If you play another macro, or use a plugin, then the variable will be lost.

If you want to store the variable for use later then you need to save it to disk. Let me know if that’s what you’re trying to do and I’ll explain the code.

HTH,

thanks marcus!

I’m writing a quick alpha hotkey/macro so I can be in edit mode on a mesh, then push into a quick black and white alpha painting session on a 1024 1024 canvas, then pop back to my previous state and paint using that alpha. seemed like a good little tool for folks who like me who like detailing with alphas and don’t like using interfaces.

I’ll upload the stubbed in macro in a few.

hmmm… so it looks like I need to be able to store the current 3D tool across both macros, do I really need to write the variable to file?.. no global variables in the language?

will monkey with it. really wish the scripting wiki doc were more robust. what I’m doing seems like it would be pretty common. guess I’ll have to edit the wiki when I’m done with this. :slight_smile:

-b

here’s what I have so far. kinda works.

still left to do:

-store the current 3D tool as a variable instead of a hardcoded name.
-figure out how to delete the alpha’s so I don’t fill memory with too many alphas. can’t I overwrite an existing alpha?
-figure out how to skip the prompt for saving the document.

I have the hotkey ~ and alt ~ bound to it. makes for a great fast workflow for hard modelling.

You can save variables between ZBrush sessions by saving to file using VarSave & VarLoad. If you’ve got a lot you can copy them to a list first.

If you simply want to use the same variable throughout a single ZBrush session then you can use a memory block. For float variables you can use the shorthand version MVarDef. For strings then you simply create the block then use MemWriteString.

You can’t overwrite an alpha or clear the alpha palette.

Most dialogs can be avoided by wrapping the command in an IKeyPress,13, (which is the equivalent of pressing Enter), though naturally this will result in whatever the default option is.

A little boy wow gold of eleven, who had wow power levelingbeen thoughtfully assisting in the packing, joined wow power leveling the group of men, and as they rubbed their chins he

spoke up, blushing wow power leveling at the sound of his own voice: "Aunt have got a great fuel-house, and it could be put

there, perhaps, till you’ve found a place wow power leveling to settle in, sir."