Jump to content

Recommended Posts

How can one group multiple layers in a Macro? I can record a Group operation, but what is the envisioned usage of that if I am unable to have more than one layer selected before it. Also doesn't seem possible to record moving a layer into a group.

Share this post


Link to post
Share on other sites

Two options

1. Edit > Cut the layer you want to add to the group, select the Group then Edit > Past Inside to add the layer to the Group.

2. Select all layers, Set visibility for all layers to off, deselect all layers, select the 1st layer you want in the group and set visibility for that layer back on, repeat for all other layers you want in the group, then select all layers (only visible layers will be selected), Group them. To switch visibility for all other layers back on again first deselect all layers then Layer > Show All

I will let you find out the limitations of the above 2 options in certain circumstances as I am getting more and more frustrated with what should be simple macro commands and what actually happens when the macro records them.


Due to the ongoing Brexit negotiations, punctuation, spelling and grammar will be used sparingly until further notice.

Share this post


Link to post
Share on other sites
4 hours ago, carl123 said:

I will let you find out the limitations of the above 2 options in certain circumstances as I am getting more and more frustrated with what should be simple macro commands and what actually happens when the macro records them.

One of the biggest limitations for me is that I have found no acceptable way to specify a particular layer that works for documents with an arbitrary number of layers.

 

If the layer structure is simple enough, I can start the macro by giving each layer a unique name, using the 'Select layer1 from the top' option for the first & then the 'Select layer 1 below current' for each of the others in turn, so that afterwards I can select any layer by name. Of course, the problem with that is it overwrites any layer names I might previously have created for the file. There is also an option to select a child layer by its number, but without knowing how many child layers a file might have, I don't know how to make sure each of them is selected in turn, or what would happen if the macro has a 'select child 4' step but the parent has fewer than 4 children.

 

If there are any workarounds for this I would love to know what they are, but I suspect the only real solution is a scripting language that supports variables, conditionals, error handling, & so on.


Affinity Photo 1.6.7 & Affinity Designer 1.6.1; macOS High Sierra 10.13.6 iMac (27-inch, Late 2012); 2.9GHz i5 CPU; NVIDIA GeForce GTX 660M; 8GB RAM
Affinity Photo 1.6.11.85 & Affinity Designer 1.6..4.45 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.1.1

Share this post


Link to post
Share on other sites

I tried both options and it appears you can't do any of that whilst recording a macro. What I mean is, I want to group four or five adjustment layers together so I can add a single mask to them and I cant seem to find a way of recording this operation in a macro.

Share this post


Link to post
Share on other sites

One nice difference between version 1.6.7 (the retail version) and version 1.7 (the beta) is the addition of "Move Inside" and "Move Outside" on the Arrange menu. When I choose a layer immediately above an existing group, choosing the "Move Inside" command will put that layer into the group. The other thing you have to know about navigating in and out of groups is that, once you have chosen a layer inside a group, the only way to get out of the group is to choose the group itself (the "parent layer") and then add layers, move around, etc.

I have attached 2 files. The first is an .afphoto file with a picture of a Red Flower and 4 adjustment layers on top of it. Open this file WITH THE BETA VERSION, not the retail version. The second file is a zipped .afmacro file. Import this from the hamburger menu in the MACROS panel (not from the Library panel). When you run the macro, it initially chooses the bottom layer (the photo itself) and then sequentially moves up the stack to the 4 adjustments. At the first adjustment, it creates a Group. At the 2nd, 3rd, and 4th adjustment layers, it uses the "Move Inside" command. Then, the Group itself is selected and the "Add Mask" command is given.

This should demonstrate that what you are trying to do is certainly possible, even without scripting, variables, loops, etc.

Red Flower with 4 Adjustments.afphoto

Group Adjustments & Insert Mask.afmacro.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×