Macros provide an easy way to record tasks you do often, so that they can be replayed at the press of a button. Supposing you like to model with zspheres using a particular background color and material; a macro will save you having to go through the same set up procedure each time.
Macros are plain text files that use the ZBrush scripting language ZScript to record instructions, in much the same way as recording a zscript thru the ZScript Palette. The major difference is that macros automatically become part of the ZBrush interface, so that they are available every ZBrush session, can be repositioned on a custom interface set up, and assigned a hotkey.
If you are familiar with zscripting you can edit (or even write) a macro if you wish. ZBrush recognizes the macro by its special button name of three question marks: ???. Otherwise the macro is composed of standard ZScript commands. Here is an example, which sets up a zsphere ready for modeling:
Ago
marcus_civis,
I tested it again on different subtools and it appears to be happening on one single ZTL, the rest of the time it works fine so its probably something with my zbrush or that particular file
But yeah I want to thank you again for this little script And I hope pixologic brings back the old dynamic size brush behavior or at least gives an option to turn it off
Anyway, it should be turned off on all brushes by default and let the user choose to turn it on for a specific brush and not the opposite. It is useful for detail brushes like stitches and lines but there is no reason to have it on for brushes like smooth, mask, selection and all the other brushes for that matter. it is just annoying and distracting.
One thing I am hoping for is a way to edit a macro by inserting a step somewhere other than at the end of the existing steps. I would also like to be able to just save the edited version as a replacement for the unedited version, overwriting it, instead of the save creating a new macro.
In particular, I would like to be able to add one or two steps at the very beginning of an existing macro. I have several macros whose current first step is Duplicate, but I have realized that they would work better if I inserted a Clear selection & a Set current selection step before the Duplicate step to set the document to a known state.
For some reason I did not think it was possible for one macro to call another macro so I never tried doing that before but after reading your post I just tried it ... & it works! I have not yet checked to see if it still works if a called macro's name is changed, & of course I would not expect it to work if the called macro was later deleted, but even so it opens up quite a few possibilities for a more modular approach to using macros that I want to explore.
However, there is still one thing stopping me from doing what I wanted to do for macros that start with a Duplicate layer step. My (less than brilliant) idea was to use the the named layer choice with the Set current selection step to make sure my macro operated on the layer named "Background." I had hoped that if there was no layer with that name, the macro would throw an error & stop.
As an example, attached is a macro that duplicates the currently selected layer (which must be named "Background" for everything to work right), names it "RED" & then duplicates the layer named "Background" twice more to create duplicates named "GREEN" & "BLUE." After that, it is easy to select each of the duplicates by name, which this macro uses to clear two color channels of each of them, leaving the RED layer with just the red color channel values of the original layer, the GREEN one with just the green channel ones, & so on.
Difficulty is it's very hard to see what's going with AF macros as there is no real way to debug. The history palette shows only the macro name and not the steps, and the macro recorder/player has no single step debug function. I love the way the AF macro recorder can handle Dialogues but in other respects (no multiple layer select, no functional cut, copy, paste, and numerous other basic steps) it still has a way to go. Lets hope this is one of the major improvements in the next release.
After selecting a layer in the Layers panel, the Channels panel shows below the Composite channels a second set of channels for that layer only, with Composite replaced in the channel name with the layer name, like this:
Because the default height of the Channels panel is not very tall, you may have to scroll down to see the layer channels. I find it more convenient to float the Channels panel & make it tall enough to see all the channels without scrolling.
The only way I have found to debug a macro is by tedious trial & error. The AP help topic is not at all helpful with this -- it even says, "Through the Macro panel, you can record any operation in Photo; from applying a Gaussian Blur to adding a gradient fill." Of course, this is far from true, so we are left to discover for ourselves what operations it actually supports & (to put it kindly) any quirks the supported ones might have.
That is even more tedious than it needs to be because (among other things) as you said there is no way to step through a macro; or to reorder or insert new steps among the existing ones, or even to save edits back to the original macro without creating a new one.
Whilst there is little you can do to insert or remove lines in macros I have discovered there are two things you can do to modify an existing macro. You can switch instructions off by unchecking them and, once you have it open in the editor, you can hit Record and start recording again to append extra instructions onto the end. I never realised this until I tried it today.
I have turned off the last three lines of your macro which deselected the blue layer, selected the 'Background' layer, and turned off it's visibility. This causes the original macro to terminate with 'BLUE' layer selected. I have then appended the following two lines: Move down one layer relative to selected, Turn off visibility.
That's it. As far as I can see it works perfectly. I hope so and that there isn't some pitfall awaiting. I am reasonably confident it is watertight.
So it's my thank you for teaching me something about channels that I didn't know. :)
That is the problem that initially caused me to hope that by starting with a Clear selection step followed by a Set current selection step (so I could specify the Background layer explicitly by name in the second step of the macro) it would stop if the Background layer was not preselected.
Well yes - that may be. But no macro can be expected to run correctly if run under incorrect circumstances. Error checking and avoidance lies more in the province of full scripting. It's kind of axiomatic that you need to start with a layer selected for a macro to work on. Not sure there's a way out of that. ;)
The problem is that it can work with no layer selected once the macro has been saved. During recording you can specify a layer by relative position (one from the top, one from the bottom, etc.) but unless the relative position of the layer you want the macro to target will never change, then the macro is not going to be very useful -- consider a 20 layer document with some edits already applied for example.
That leaves the select by name option (like Select layer named "Background") as the closest thing we have to a non-relative selection. But if there is no layer with that name, when the macro is run it just selects a layer anyway & starts running its steps on that. The simplest way around that is to make the macro do nothing (with or without an error) if the named layer does not exist.
I am rather lost as to why you seem to need this so complicated. This particular macro breaks down a layer into it's RGB components. Why is it problematic to simply select the layer you want to do this to before running it?
Yes it would lovely if it could tell if you don't have one selected and bail out. But macros are not scripts that can make conditional choices and they are not supposed to be. They are simply recorded sequences of actions with very limited feedback (Photoshop actions have far less interaction than AP's macros).
Certainly if AP's own error checking were better, when it comes to asking it to do things it shouldn't, then some of what you seem to be seeking might exist as an intrinsic part of the app regardless of whether called from a macro or performed manually. I have frequently complained about AP's tendency to plough on regardless and fail if I ask it to do something it can't (like trying to apply FX to a mask layer) instead of sending me a warning. This is something that needs improving - but it is not macro specific, it's global.
AP (and all graphics utilities) demand to be used with a certain degree of respect for certain basic requirements - like having layers selected if you want to apply FX or filters to them. Macros are no exception to this as they are simply a dumb sequence of recorded steps, warts and zits included.
EDIT: More simply, if during recording the macro asks me to make a choice between selecting a layer by its relative position or by name, then if it can't do the latter during playback, that by name choice should not be available during recording to begin with.
Deciding whether to make an action record a layer name or a relative layer was always a problem in PS too as actions didn't provide the wherewithal to stop and input a name on playback either. (At least not up to CS6. It may have changed since). Many PS actions depended on you being on a particular layer type or layer before being run. I have always simply accepted this a limitation of actions and have accepted it as a limitation of macros too.
c80f0f1006