noRepeats
Last updated
Was this helpful?
Last updated
Was this helpful?
If a mockup has multiple smart object targets, the script makes sure each of them uses the same amount of input files by repeating the existing input files as many times as needed to ensure all targets in a mockup have the same amount of input files. The goal with this default behavior is that every single output would contain something instead of ending up with output images where some of the smart objects are empty.
In this case @black-mug has 4 input files and @white-mug has 2 input files. The green logo is the last input file in each.
If you use noRepeats: true
you either have to make sure each smart object target has the same amount of input files or just live with the fact that some output files will end up with objects with missing graphics.
If you choose to keep the input files uneven and use noRepeats: true
, you may need to make sure that nothing unnecessary below the target smart object becomes visible because the target layer is hidden after it runs out of images.
Just to reinforce the idea already explained above.
Columns @phone, @tablet @laptop represent a smart object target within one mockup file, and each row shows which input files end up in which output file.
output (mockup.psd)
@Phone
@tablet
@laptop
mockup 1.jpg
1.jpg
1.jpg
1.jpg
mockup 2.jpg
2.jpg
2.jpg
2.jpg
mockup 3.jpg
3.jpg
3.jpg
mockup 4.jpg
4.jpg
4.jpg
mockup 5.jpg
5.jpg
mockup 6.jpg
6.jpg
mockup 7.jpg
7.jpg
output (mockup.psd)
@phone
@tablet
@laptop
mockup 1.jpg
1.jpg
1.jpg
1.jpg
mockup 2.jpg
2.jpg
2.jpg
2.jpg
mockup 3.jpg
3.jpg
3.jpg
mockup 4.jpg
4.jpg
4.jpg
mockup 5.jpg
5.jpg
mockup 6.jpg
6.jpg
mockup 7.jpg
7.jpg
Missing input files are marked with and to recap, when the script starts working on mockup 3.jpg
, the @tablet smart object will be hidden because it ran out of input files and the layer will stay hidden after that. Same happens to @laptop smart object when it starts saving mockup 5.jpg
.
Input files that will repeat in multiple output files files are marked with.
1.jpg
2.jpg
1.jpg
1.jpg
2.jpg
2.jpg
1.jpg
3.jpg