Photoshop Generator: Create Folders in Image Assets

  • 7
  • Idea
  • Updated 3 years ago
  • Implemented
  • (Edited)
Hello! I'm loving the Adobe Generator for Photoshop and use it a lot!

A useful feature i'd like to see is to specify/create folders to save the assets. Something like:

folder/asset.png

It would be great to generate Android assets, when we have files with the same name, but in different folders (mdpi, hdpi, xhdpi, etc)

Thanks!
Photo of Victor Hugo Prando da Silva

Victor Hugo Prando da Silva

  • 9 Posts
  • 5 Reply Likes

Posted 5 years ago

  • 7
Photo of Florian W

Florian W

  • 2 Posts
  • 0 Reply Likes
This reply was created from a merged topic originally titled
Photoshop: Allow for Generator to create folders.


There should be some more photoShop Generator additional configuration options:

for starters basic ones like:
- Folder where files should be stored.
- Allow subfolders -> either by allowing '/' in files...or making the top folder...a "real" folder in the exported file structure...
Photo of Kyoko Itoda

Kyoko Itoda, Photoshop QE

  • 27 Posts
  • 3 Reply Likes
Have you visited Adobe Photoshop Generator Github?
They are already working this type of request.  see https://github.com/adobe-photoshop/generator-assets/pull/190





Photo of Joel Brandt

Joel Brandt, Employee

  • 2 Posts
  • 0 Reply Likes
The page that Kyoko links to covers the work we've done to specify folders.

We're also working on document-wide defaults. You can find out more about that here: https://github.com/adobe-photoshop/ge...
Photo of Michael Ahokas

Michael Ahokas

  • 3 Posts
  • 0 Reply Likes
This reply was created from a merged topic originally titled
Enable Photoshop Generator to save to different folders.


The Generator in Photoshop CC is great. It would be even better if it allowed you to export assets to different folders. For example, say I have an icon and I want to generate 1x and 2x assets for iOS and 1x, 1.5x, 2x, 3x, and 4x assets for Android. I would like them to go to different folders (e.g. iOS, Android/hdpi, Android/xhdpi etc).

Currently it requires a bit of effort to sort stuff out after generating them. It would be nice if it were easier.

Perhaps it would be enough if you could add a path to the layer name so if you wanted to export icons in the following way:

ios/icon.png
ios/icon@2x.png
android/mdpi/icon.png
android/hdpi/icon.png
android/xhdpi/icon.png

you could name the layer like this:
ios/icon.png, 200%ios/icon@2x.png, android/mdpi/icon.png, 150%android/hdpi/icon.png, 200%android/xhdpi/icon.png
Photo of Jaime Murray

Jaime Murray

  • 2 Posts
  • 0 Reply Likes
Michael, you can do that now, just not in the layer name for each asset you are exporting. See my answer below to use a "default" layer to save all of your assets to different folders.
Photo of Joel Brandt

Joel Brandt, Employee

  • 2 Posts
  • 0 Reply Likes
Hi Michael,

Good news! We have folder support in Generator slated for the next release of Photoshop. You can read about it here if you're interested:

https://github.com/adobe-photoshop/ge...

Also, we have a feature in the works to allow users to specify document-wide defaults -- feel free to comment on the syntax or suggest additional use cases:

https://github.com/adobe-photoshop/ge...

Best,
-- Joel
Photo of Erin Hovland

Erin Hovland

  • 2 Posts
  • 1 Reply Like
I'm really enjoying the ability to put assets into different folders, but one problem I've been having lately is that I want to create multiple folders that contain the same file. Is there a way to do this without getting the "duplicate file name" error?
Photo of Victor Hugo Prando da Silva

Victor Hugo Prando da Silva

  • 9 Posts
  • 5 Reply Likes
I'm having the same problem here :/
Photo of Pete Green

Pete Green, Customer Advocate

  • 721 Posts
  • 136 Reply Likes
Thanks for the report Erin and Victor, We're aware of this and have a fix in hand. Stay tuned for future updates.
Photo of Tirza van Dijk

Tirza van Dijk

  • 1 Post
  • 0 Reply Likes
This is a function I've been waiting for a long time. It would make Android app assets exports a lot easier and quicker!
Photo of Jaime Murray

Jaime Murray

  • 2 Posts
  • 0 Reply Likes
Not sure about the fix that Pete Green is talking about, but you can do this now using the "default" layer technique to save multiple versions of the same asset.

Let's say you have a layer named "icon.png" in a file named "MyIcons.psd". That layer would get saved to the file "MyIcons-assets/icon.png". No problem.

But to save multiple versions of that file, for example for different resolutions of Android devices as mentioned above by Tirza, you can save that same "icon.png" file to different folders. You have to create an empty layer in MyIcons.psd and the first part of that layer name must be "default". This layer will tell Generator how to save all of the tagged layers in the document. Name your "default" layer like this:

default 100% android/res-hdpi/, 75% android/res-mdpi/

This will create two versions of "icon.png": "MyIcons-assets/android/res-hdpi/icon.png" (at the size it appears in your document, 100%) and "MyIcons-assets/android/res-mdpi/icon.png" (at 75% of the size since Android's MDPI density is 75% of HDPI). As long as you're indicating different folders in the "default" layer, you won't get the duplicate file name errors.

Also, if you're saving to different resolutions it seems best for your PSD file to use the highest resolution/density that you are supporting and to scale down from there, though if you are using mostly vector shapes you shouldn't have a problem.
Photo of Erin Hovland

Erin Hovland

  • 2 Posts
  • 1 Reply Like
This sounds very handy for situations where I want everything in my file to be duplicated and/or resized, but is not so useful when I'm in a situation where I would need the folders to contain something like:

android/
icon_36.png*
icon_72.png*
icon_92.png

iOS/
icon_29.png
icon_36.png*
icon_40.png*
icon_50.png
icon_72.png*
icon_76.png
icon_100.png

Newsletter/
icon_40.png*
icon_72.png*

Website/
icon_72.png*
icon_1024.png

*items with duplicate files in other locations

I don't want to litter my folders with unnecessary files. Plus, there are situations where I need two files that are different, but have the same name (ex. icons/square/icon72.png, icons/rounded/icon72.png).

For now, I've worked around this by naming files "icon72.png, _icon72.png, __icon72.png, ___icon72.png" and then cleaning up the underscores afterwards. Are there any other tricks I might be missing to help me get around this problem?
Photo of Gary Tang

Gary Tang

  • 17 Posts
  • 2 Reply Likes
what about extract to a outside of that psd file folder some other location or different server? and it will remember it next we open that psd file?
Photo of Tony Astley

Tony Astley

  • 3 Posts
  • 0 Reply Likes
Using the layer name to control output feels like a bit of a cop out. Hopefully in future updates we could have a layer effects style GUI for controlling the output without having to result to ridiculously lengthy layer names.

An empty layer to control default settings doesn't feel like the team finished the feature.
Photo of irina maderych

irina maderych, Employee

  • 38 Posts
  • 5 Reply Likes
Have you tried new Export? File->Export ->Export As, or right-click on layer or layers and select Export As from context menu. This will allow to export layers without renaming it, and to specify location where to export
Photo of Tony Astley

Tony Astley

  • 3 Posts
  • 0 Reply Likes
Good point. However, I really like the automatic generation this 'plug-in' offers. If we had a GUI offering the level of control SFW offers for those of us whom want it - I would never use SFW again.
Photo of Gary Tang

Gary Tang

  • 17 Posts
  • 2 Reply Likes
do I need to export every time?
Photo of Gary Tang

Gary Tang

  • 17 Posts
  • 2 Reply Likes
or it will remember where did that file export it to from last time?
Photo of irina maderych

irina maderych, Employee

  • 38 Posts
  • 5 Reply Likes
it will remember location where you exported files, and settings used for export; but to update/re-export, you need to reopen Export dialog.
Photo of Gary Tang

Gary Tang

  • 17 Posts
  • 2 Reply Likes
sounds like Generator is a better solution and did they improve that on CC 2015
Photo of Tony Astley

Tony Astley

  • 3 Posts
  • 0 Reply Likes
I'm also finding a little flaky. I currently have a document open with layers named appropriately that did export at first, but now are not exporting. I increased the DPI of the file in between it working and not working.

Plus it would be killer if it could draw resolution from inside raster smart objects when exported 200% sized assets.
Photo of john beardsworth

john beardsworth

  • 1095 Posts
  • 257 Reply Likes
Is there a way to specify the root folder for asset generation?

At present it defaults to "MyOriginalFileName-assets". I'd like to change this to "MyCustomFolder".