Jump to content
LCamachoDesign

[APh] Replace Image doesn't work with Macros

Recommended Posts

I was trying to achieve pseudo image layers by mixing the Replace Image function with Macros. Here's the basic idea:

  • Draw a red circle in some application (Illustrator for example), export that as a PNG image, let's call it circle.png
  • Place circle.png into an Affinity Photo file
  • Edit circle.png elsewhere so the circle is blue now
  • Use the Move Tool to select the placed image layer inside the Affinity Photo file
  • Press the Replace Image button in toolbar, choose the circle.png image again
  • The placed image now shows a blue circle as expected

This works great! Let's try to automate it with a Macro:

  • Place the circle.png image, with the circle back to red
  • Edit the circle.png file elsewhere so the circle colour is now blue
  • Start recording a Macro
  • Select the placed image layer with the Move Tool
  • Press the Replace Image button, chose the circle.png image again
  • The circle is now blue as expected
  • Stop recording the Macro
  • Edit the circle.png file so the circle is now purple
  • Run the Macro
  • You'd expect the placed image to change into purple but it remains blue instead

It get's even weirder, continuing from above:

  • Manually select the placed image layer with the Move Tool
  • Use the Replace Image button to select the circle.png which is purple as you recall from above
  • The placed image changes to purple as expected
  • Run the macro we created above
  • The placed image colour goes back to blue even though the blue source file no longer exists!

If more details are needed do let me know.

Thanks!

 

EDIT

 

Here's another thing to try as a follow up to the above:

  • Restore the circle.png to red again
  • Place it in the Affinity document
  • Create another unrelated image, with the same pixel dimension to simplify, call it unrelated.png
  • Edit the circle.png to blue
  • Start recording a new Macro
  • Select the placed image layer with the Move Tool
  • Use the Replace Image button to select the unrelated.png for the sole purpose/hope of "clearing cache/buffer"
  • Deselect the layer, and reselect it again, just to be sure the Macro will select the one
  • Use the Replace Image button again, choose circle.png
  • Deselect and stop recording
  • Run the Macro
  • Same thing happens, no image replacement, even with the extra step

I'd think that trying to replace the placed image with another with the same name could be causing the issue, but that's not the case, even by choosing an intermediate unrelated image file won't help. :/

Share this post


Link to post
Share on other sites

HI LCamachoDesign

 

The placed image is not a linked operation it is embedded, so the macro caches whatever was placed when it was created. This allows you to keep using the macro after the file has been deleted or if you import the macro on another system. unfortunately copy also does a similar thing but that's a different issue

 

Cheers


Serif Europe Ltd - Check the latest news at www.affinity.serif.com

Share this post


Link to post
Share on other sites

I see. That's unfortunate, it would be a very elegant solution for mockup design. Is there any way to override the caching behaviour? Or can this be changed in future builds? (Or proper linked files ;))

Thanks!

Share this post


Link to post
Share on other sites

Hi LCamachoDesign

 

I believe there may be plans to allow linked files to be placed as well as embedded ones, however I would not be able to say when and what effect this would have on macros

 

Cheers


Serif Europe Ltd - Check the latest news at www.affinity.serif.com

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

×