Jump to content

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Windows 10 Home, version 1903 (18362.145), 16GB memory, Intel Core i7-6700K @ 4.00Gz, GeForce GTX 970
Affinity Photo 1.7.1.404 and 1.7.1.404 Beta   / Affinity Designer 1.7.1.404 and 1.7.1.404 Beta  / Affinity Publisher 1.7.1.399 Beta

Share this post


Link to post
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.


Affinity Photo 1.7.1 & Affinity Designer 1.7.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.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Windows 10 Home, version 1903 (18362.145), 16GB memory, Intel Core i7-6700K @ 4.00Gz, GeForce GTX 970
Affinity Photo 1.7.1.404 and 1.7.1.404 Beta   / Affinity Designer 1.7.1.404 and 1.7.1.404 Beta  / Affinity Publisher 1.7.1.399 Beta

Share this post


Link to post
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.


Affinity Photo 1.7.1 & Affinity Designer 1.7.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.7.0.135 & Affinity Designer 1.7.0.9 for iPad; 6th Generation iPad 32 GB; Apple Pencil; iOS 12.3.1

Share this post


Link to post
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.

 

Share this post


Link to post
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.:)

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

×