Jump to content
You must now use your email address to sign in [click for more info] ×

layer selection in macros


Recommended Posts

I've created a pixel layer that I want to paste to the top of a number of .afphoto files. I thought I would create a macro to do that so I opened an .afphoto file, started recoding a macro, then selected the top layer of the image.

At that point a dialog opened up, giving me choices such as, "select layer named xxx," "select layer one above current," "select layer 2 from the bottom," etc. The choices varied depending, I guess, on what layer I selected after starting to record the macro. I have 2 questions about this:

1) What decides what choices are offered, and 

2) Why is one of the options not "select top layer," which is what i wanted? They are, after all, very specific choices, so why not that specific one?

thanks

Link to comment
Share on other sites

  • Staff

Hi NcJohn,

As far as I'm aware the Macro recording just goes on the Z order of the Layers tab. We are aiming to improve the Macros feature in the future in order to make it possible to create more complex Macros.

Thanks

Callum

Please tag me using @ in your reply so I can be sure to respond ASAP.

Link to comment
Share on other sites

6 hours ago, Callum said:

Hi NcJohn,

As far as I'm aware the Macro recording just goes on the Z order of the Layers tab. We are aiming to improve the Macros feature in the future in order to make it possible to create more complex Macros.

Thanks

Callum

I don't know what "the Z order" means.

Link to comment
Share on other sites

14 hours ago, Callum said:

Hi NcJohn,

As far as I'm aware the Macro recording just goes on the Z order of the Layers tab. We are aiming to improve the Macros feature in the future in order to make it possible to create more complex Macros.

Thanks

Callum

Callum, I don't really understand how that relates. Here's a screenshot of the dialog after I start recording a macro and try to select a layer. If the dialog can give me a choice of "layer 2 from the top" then why not a choice of "top layer"?

layer order.jpg

Link to comment
Share on other sites

1 minute ago, ncJohn said:

Here's a screenshot of the dialog after I start recording a macro and try to select a layer. If the dialog can give me a choice of "layer 2 from the top" then why not a choice of "top layer"?

Show us your layer stack (Layers panel) before you start recording the macro.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

7 hours ago, ncJohn said:

I don't know what "the Z order" means.

FWIW, the term comes from the similarity to the "Z" axis in 3 dimensional coordinate systems. X & Y correspond to width & height, & Z to depth, so in a 2 dimensional app like Affinity Z is the layer stacking order.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

6 minutes ago, walt.farrell said:

Show us your layer stack (Layers panel) before you start recording the macro.

Well, Walt, thanks to your question I believe I've figured it out.

But first, the image I uploaded before was not of the picture I was actually working on; it was just something I did quickly to show the dialog choices. I tried to delete it from the post but can't seem to do that.

Now here's the real deal, the layers panel and the macro recorder's layer selection dialog for the picture I was working on. This is after I started the recording and selected the top layer. It occurs to me that all of the choices are just different ways of referring to the same layer; I didn't notice that before because, to me, "layer 1 from the top" is not the same as "top layer." I never even bothered to click "select" in the dialog because I didn't realize that "layer 1 from the top" is what I wanted. And when I did click "select" it did indeed select the top layer.

So thanks for your post.

layer order.jpg

Link to comment
Share on other sites

18 minutes ago, R C-R said:

FWIW, the term comes from the similarity to the "Z" axis in 3 dimensional coordinate systems. X & Y correspond to width & height, & Z to depth, so in a 2 dimensional app like Affinity Z is the layer stacking order.

Makes sense. Thank you for that info.

Link to comment
Share on other sites

I think I've just had an epiphany, which I'm going to share here for anyone who comes along and knows even less about this than I do.

I've thought of the top layer as being the "top of the stack," with the bottom layer being the "bottom of the stack." In that context, there are some weird selection choices in that dialog. But if you think of the "top of the stack" as being above the top layer (and the "bottom of the stack" as being below the bottom layer), then it all makes sense.

Thanks again for the replies.

Link to comment
Share on other sites

9 hours ago, ncJohn said:

It occurs to me that all of the choices are just different ways of referring to the same layer; 

Glad you've got it figured out, but there's one subtlety you might not have recognized.

Yes, with your current layer structure and types all those choices are referring to the same layer.

But consider that you're creating a macro, which will have to operate on different documents, with different layer structures: more layers, fewer layers, nested layers, adjustment or pixel layers in different orders, ....  Or in a document where the user may start with a different layer selected.

In those situations those choices might be different layers.

Example: suppose you recorded it using "select layer 3 above current". For you, right now, that's the top layer. But if you can your macro against a document with 5 layers rather than 4, it would be the layer below the top layer. Similarly, if run with something other than the background layer selected, you'd get something different.

So, in reality, each of your allowed choices during recording may mean something different when the macro is run on different documents. And that's a feature that helps you write macros that work in different situations.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

9 hours ago, ncJohn said:

I've thought of the top layer as being the "top of the stack," with the bottom layer being the "bottom of the stack." In that context, there are some weird selection choices in that dialog. But if you think of the "top of the stack" as being above the top layer (and the "bottom of the stack" as being below the bottom layer), then it all makes sense.

I think the best way to think about it is "...from the top" means counting from the top of the layer stack & likewise "...from the bottom" means counting from the bottom of the layer stack. So for example, "Select layer 1 from the top" always selects the top layer & "Select layer 1 from the bottom" always selects the bottom layer ... I think. :S

Personally, wherever possible I try to remember to name any layers I create in a macro. That is easy to do immediately after creation since the just-created layer becomes the currently selected one & thus the target of the following name step. That way, selecting any of them as a later step in the macro can be done by name, avoiding the need to count layers or consider how many of them are in the document. If the name is descriptive enough, that also makes it easier to see which layers do what later on, after the macro has been applied.

The only problem with this is the layer name has to be unique -- if two or more layers have the same name, the 'by name' step apparently always selects the lowest one in the layer stack. I think what should happen in this case is the 'layer by name' option should be unavailable, with something like a "Cannot select layer by name (name not unique)" explanation, but as it is now it can be a major 'gotcha' that causes undesirable results when the macro is run.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

6 hours ago, walt.farrell said:

Glad you've got it figured out, but there's one subtlety you might not have recognized.

Yes, with your current layer structure and types all those choices are referring to the same layer.

But consider that you're creating a macro, which will have to operate on different documents, with different layer structures: more layers, fewer layers, nested layers, adjustment or pixel layers in different orders, ....  Or in a document where the user may start with a different layer selected.

In those situations those choices might be different layers.

Example: suppose you recorded it using "select layer 3 above current". For you, right now, that's the top layer. But if you can your macro against a document with 5 layers rather than 4, it would be the layer below the top layer. Similarly, if run with something other than the background layer selected, you'd get something different.

So, in reality, each of your allowed choices during recording may mean something different when the macro is run on different documents. And that's a feature that helps you write macros that work in different situations.

Yes, I have figured all that out; the realizations just keep coming! :) It's a very ingenious dialog and was very puzzling at first, but I think I've got it figured out.

And, having figured out that the "top layer" is not the "top of the stack" I think "layer 1 from the top" should always be safe for my specific use with this specific macro. (I think.)  

Thanks again.

 

Link to comment
Share on other sites

5 hours ago, R C-R said:

I think the best way to think about it is "...from the top" means counting from the top of the layer stack & likewise "...from the bottom" means counting from the bottom of the layer stack. So for example, "Select layer 1 from the top" always selects the top layer & "Select layer 1 from the bottom" always selects the bottom layer ... I think. :S

 

I think you're right. I also think you've chosen the perfect emoticon for a tricky topic.:)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.