Home Technical Talk

Texture manager V1.0

Perfect_Storm
polycounter lvl 2
Offline / Send Message
Perfect_Storm polycounter lvl 2
Hello everybody!

In my years of game development I got really tired of saving tga files from your PSD file.
I have checked the internet several times for a program that can split my PSD file into tga files, but all I could find were slow scripts or not easy to use.
So I figured it would be time to write one myself.
The goal was to speed up exporting tga files and it should be very stable as well.

I recently finished version 1.0 and after some testing I think it's time to spread this thing into the world, because I believe everybody should experience this simple tool.

In short it works as follows:

Your PSD contains several folders with all the different export types.
For example, Diffuse, Alpha, Normal map, Gloss, Spec, etc etc.
Here is an example of a PSD folder setup:

TM01.gif

In the past, you kept copying your diffuse to your TGA, and your alpha in your alpha slot. Doing this all day long, you are loosing valuable time very easily.

Texture manager will help you export these files very quickly.
It has the option to set a source root folder and a destination root folder.
This way, you only have to set this once per project.
For example, if you have a project and you have a folder structure like this:

- Unity/Source/Textures/Structures
- Unity/Textures/Structures

You can set the source root to Unity/Source and the destination root to Unity. The texture manager will then export your files to the right folder.

Lets have a look at the options of Texture Manager:

TM02.jpg

Texture manager has a build in perforce checkout to quickly checkout or add (new) files in perforce.
You can export in tga, bmp, png or jpg format. Only tga supports alpha channels.

In the Group menu you can define the different types of folder names in your psd.
In this example, a folder with the name DIF will be placed in the RGB channel.
Alpha is empty, but if you want to export something in the alpha channel, you can add the folder name here. (ALP for example).
You have the option to include prefix or suffix to your texture name. This could be very useful if you have multiple types of the same texture (Normal, Spec, Gloss, Emissive etc).
Also, you can resize the output if you want.
The last option is to sharpen your output. You can define the opacity of the sharpen layer by the last option box.

You can add a total of 8 different group types.

In my research, my main goal was to make this script very fast and easy to use. That's why it comes with 8 Group Export scripts. Each group has it's own script that can be bound to a hotkey in photoshop via Actions.
This way, I can save the different groups with my F buttons on my keyboard.
I already created the actions and they are included in the file.
They keys F5 - F12 now represent the different groups of the script.

So, how fast is this script? It can save your exported file including alpha in +- 2 seconds.
This drastically decrease iteration times.

DOWNLOAD TEXTURE MANAGER V1.0

Here is a movie of the Texture Manager in action:

[ame="https://www.youtube.com/watch?v=gYOq-IbzeiM"]Youtube[/ame]

Replies

  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    For everyone wondering where to put the files from the .zip:

    Extract them to Program Files/Adobe/Your Photoshop version/Presets/Scripts.
    Reboot Photoshop if you had it already opened.
  • Eric Chadwick
    Options
    Offline / Send Message
    Cool tool, thanks for sharing! Added to the wiki here:
    http://wiki.polycount.com/wiki/PhotoshopTools#Export_Tools
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Cool tool, thanks for sharing! Added to the wiki here:
    http://wiki.polycount.com/wiki/PhotoshopTools#Export_Tools

    Thank you very much!
    I included an installation guide on my website and added a readme to the download file. This should make it easier to install the script :)
  • CreativeSheep
    Options
    Offline / Send Message
    CreativeSheep polycounter lvl 8
    I ran one of the actions and it didn't work ? Then again I have a short-cut linked from an external folder into the default PsCC-2014 actions folder, it shouldn't make a difference. When I run one of the actions, suppose the first action, nothing happens.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    I use a short cut link at work as well, and that works fine. So it is not the shortcut thats causing the problem. Are the scripts visible in the photoshop menu? If so it should just work. In this case I'd advise to manually create the actions. Just press record on one of the actions and run the group of your choice. This should do the trick for sure.

    Let me know if this works or not.
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    So many scripts to save Photoshop groups as texture channels and not a single one to do so with layer comps . IMO layer comps are much more convenient to store  texture channels .   Doing it with dedicated groups  is so overcomplicated  
  • Eric Chadwick
    Options
    Offline / Send Message
    Oooh layer comps. Gotta look into this.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    gnoop said:
    So many scripts to save Photoshop groups as texture channels and not a single one to do so with layer comps . IMO layer comps are much more convenient to store  texture channels .   Doing it with dedicated groups  is so overcomplicated  
    I updated the script locally to split groups in RGB as well. I can have a look into layer Comps this weekend. I'll keep you informed.
  • Synaesthesia
    Options
    Offline / Send Message
    Synaesthesia polycounter
    Layer Comps are an essential part of my workflow. Having a little checklist to switch between different states in a PSD is absolutely invaluable.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Layer Comps are an essential part of my workflow. Having a little checklist to switch between different states in a PSD is absolutely invaluable.
    So, I'm having a look at the script, trying to integrate Layer Comps in stead of Folders.
    But I'm wondering how you guys see this working.
    What if you have a diffuse with alpha. Would you then have 2 layer Comps? 1 named DIF and 1 named DIFALP (Or something like that)
    And what if you not only have a diffuse with alpha, but also for example specular? Would you then have 2 layer comps named SPC and SPCALP?
    You clearly can't have only 1 layer Comp named ALP because that could overlap between textures.

    I'm curious how you guys feel about this. I would personally say DIF and DIFALP. The names can be altered to your liking in the configuration of course.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Ok guys, I created a first draft of a version that supports Layer Comps.
    Could you please check if this is what you are looking for?

    There is an extra option in the configuration window, called "Use Layer Comps as groups"



    If you enable this option, you will be able to use layer comps in stead of folders.

    Disclaimer: 
    It's a first version. Sharpening doesn't work yet. I will update this later with a better, properly tested, version.

    Download (Extract both files to Program Files/Adobe/Your Photoshop version/Presets/Scripts):
    http://www.ronkamphuis.nl/TextureManagerLayerCompsV10.zip
  • Synaesthesia
    Options
    Offline / Send Message
    Synaesthesia polycounter
    This looks fantastic! I'll definitely give it a shot soon.
  • Synaesthesia
    Options
    Offline / Send Message
    Synaesthesia polycounter
    Just tried loading it. Nothing happens. Both files are installed in CC2014\Presets\Scripts.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Just tried loading it. Nothing happens. Both files are installed in CC2014\Presets\Scripts.
    You'll need to install version 1.0 first and override these 2 files afterwards. I didn't make a full package yet because it's a work in progress.
  • Synaesthesia
    Options
    Offline / Send Message
    Synaesthesia polycounter
    Ah, got it. My mistake.

    So far it works really well, thank you! :)

    The only problem I see is that I can't define a custom name for the exports. Say I've got a PSD called Test_Base_4096.PSD. I'd like each Layer Comp to be saved to a new name based on the comp name instead of adding a suffix or prefix to Test_Base_4096.PSD. If I have two groups called Red and Blue for color variants, I'd want Test_Blue_4096.PSD and Test_Red_4096.PSD.

    Right now it seems to save as prefix_Test_Base_4096_suffix.PSD. Did I miss a setting or do I need to manually rename files once exported?
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Ah, got it. My mistake.

    So far it works really well, thank you! :)

    The only problem I see is that I can't define a custom name for the exports. Say I've got a PSD called Test_Base_4096.PSD. I'd like each Layer Comp to be saved to a new name based on the comp name instead of adding a suffix or prefix to Test_Base_4096.PSD. If I have two groups called Red and Blue for color variants, I'd want Test_Blue_4096.PSD and Test_Red_4096.PSD.

    Right now it seems to save as prefix_Test_Base_4096_suffix.PSD. Did I miss a setting or do I need to manually rename files once exported?
    No, you're not missing a thing. The reason behind this stands from the previous layer approach, and the way I use this script in the studio I work at.
    But let's say we take your suggestion, a few changes need to be made, and a problem rises up:

    1. Instead of exporting a named group the script needs to export the selected (visible) layer comp. 
    2. Specific group properties as resizing and sharpening need to be written in the layer comp notes.
    3. There is no way to tell if/what alpha needs to be used. I don't have a good solution for this yet, although one can think of giving another layer comp the exact same name as the exported one, but with _ALP behind it or something.

    I will definitely give this approach a try, but I will probably rewrite the entire script to do this, and think carefully about it before starting. I might even start from scratch, since some things will significantly change the way the script works at the moment.

    A very easy solution would be to add an override name to a certain group. But then you'll need to change the texture manager configuration each time you load a new texture, because the name is different. This can create a lot of errors because people forgot to change it, accidentally overwriting a different texture, etc etc.

  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    I have a first version where you can determine the name of your exported file ready.
    I still need to so some optimizations and I want to be able to split RGB channels as well, so I need some additional work to the script to make it final.



    As soon as the user checks the Use Layer Comps as groups button, the groups will disappear and new options will show.
    Right now the only option is to set the alpha suffix. This is used so that the script knows what layer comp should be used as alpha for the exported group.

    Below an example.

    The group Wall_Red_DIF will be my export name.
    The texture has an alpha. It is now named Wall_Red_DIF_ALP so that the script knows it belongs to the diffuse.



    I also included the option to resize and sharpen by adding this in the layer comp notes. Simply add one of these commands:
    Sharpen <nr>
    Size <nr>

    I will continue working on this tomorrow again, and keep you informed about the progress.

    Cheers!
  • Synaesthesia
    Options
    Offline / Send Message
    Synaesthesia polycounter
    Thank you so much for taking feedback and working on the tool! I feel kinda bad here since you're doing all this awesome work for free. 
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    Thank you so much for taking feedback and working on the tool! I feel kinda bad here since you're doing all this awesome work for free. 
    That's no problem at all :smile:

    I finished the script. I decided not to start from scratch, but in stead, combine the scripts.
    I will just quickly explain the new features available when using Layer Comps:

    You can set 4 option values in the configuration screen. These are the suffixes of the layer comp names.
    This can be used to store alpha channels, or store 3 textures in 1 RGB texture (1 channel per texture)
    By default, these are set to _ALP, _RED, _GREEN, and _BLUE.



    Let's say you have a texture named Wall_Red_2048.psd
    In this PSD you have a layer comp defined, named Wall_Red_1024
    The wall has an alpha channel. This alpha channel is defined in another layer comp, named Wall_Red_1024_ALP.

    If you now hit the export button (I kept the group export buttons, but for layer comps they will all do the same, since you have to select the layer comp you want to export), a new file will be saved named Wall_Red_1024.tga (Or whatever extension you selected in the options)

    It is now named 1024, but it has not been resized.
    In order to resize exported textures, I included some arguments that you could enter in the comments section of a layer comp.
    These arguments are:

    size x
    sharpen x

    x stands for a percentage value, usually between 1 and 100.

    So, to export the wall in 1024 you'll need to add the following in the comments section of the layer comp:
    size 50 (Means 50%)

    The last thing that's possible is to split RGB channels.
    You can make 3 layer comps, all named the same, but with different suffixes corresponding with the suffixes stored in the configuration script.
    Keep in mind that these layers will be stored in 1 channel, so only grey values will be stored. You can use colors of course, but it will flatten it to greyscale.

    example of layer comp setup:

    Output would be a texture named Wall_Red_DIF.tga
    The 3 layer comps RED GREEN and BLUE will be stored in the channels RGB.
    Wall_Red_DIF_ALP will be used as alpha.



    Okey, enough talking, I think you can figure it out.
    Here's the download link:

    www.ronkamphuis.nl/TextureManagerV12.zip

    Let me know if you run into any problems.

    Cheers!

  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    Thank you very much for such a wonderful tool.    I have a  couple extra wishes.     Would be nice if the script would auto save overall transparency in a layer comp  as an alpha channel   using  free http://www.flamingpear.com/  Solidify C  plugin  to fill rgb values for transparent pixels.  If installed.

    And another wish  is a 1,277 gamma   in Image/adjustments/exposure  applied when converting from  rgb layer comp , like _RED, _GREEN, _BLUE  to greyscale  values in resulting tga file         


  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    gnoop said:
    Thank you very much for such a wonderful tool.    I have a  couple extra wishes.     Would be nice if the script would auto save overall transparency in a layer comp  as an alpha channel   using  free http://www.flamingpear.com/  Solidify C  plugin  to fill rgb values for transparent pixels.  If installed.

    And another wish  is a 1,277 gamma   in Image/adjustments/exposure  applied when converting from  rgb layer comp , like _RED, _GREEN, _BLUE  to greyscale  values in resulting tga file         


    Hello Gnoop,

    Thank you for taking the time to try the new version of the script. 
    I'll answer your second question first. This is something I can add fairly easy. I will add a checkbox in the configuration to enable or disable it.

    Your first question however, is a bit more complicated.
    Before I started on this script, I checked the internet for export scripts like this one.
    There were a lot of them, but they all had something I disliked. External plugins, buttons, but a very common mistake: slow.
    I was looking for something fast to use, and usable with a hotkey.
    The script must also run as fast as possible. (+- 3 sec max)

    In order to achieve this, I had to make some compromises.
    The user had to setup all the layers him/herself so the script could make some assumptions.

    This rule also applies for alpha.
    What you are requestion is something you can also do in the psd file. Just create an alpha layer comp with the requested alpha and put an extra layer under your diffuse texture using the solidify plugin to cover up the blank space. It's a different workflow.

    Compromises such as these make the script fast, so I won't implement this suggestion (Not even taking the technical challenges into account yet, because it also requires some heavy rewriting of parts of the script).

    I'll let you know as soon as the exposure adjustment is in.
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
      Once we need to put a depth or  roughness into alpha channel,  the special  _ALP layer comp   is totally useful . But for just transparency it's an extra manual work.     We could do an action that would do  "duplicate Merged layers only".  Photoshop keeps  same current layer comp selected in a new document in that case.   Then  the action would delete all the redundant alpha channels   and   saves overall  transparency as a new Alpha 1,  then does Solidify  C and finally would save tga with your script.   In such case your script  would only need a switchable option to keep existing Alpha1  when the script does  tga saving.

    ps. Photoshop7 didn't need Solidify at all. It just did basically same  for transparent pixels. In fact it was even better than Solidify  since it did better/smaller compressed textures.  Then Adobe issued a "bugfix" and killed the feature. Years after I am still puzzled why.

  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    gnoop said:
      Once we need to put a depth or  roughness into alpha channel,  the special  _ALP layer comp   is totally useful . But for just transparency it's an extra manual work.     We could do an action that would do  "duplicate Merged layers only".  Photoshop keeps  same current layer comp selected in a new document in that case.   Then  the action would delete all the redundant alpha channels   and   saves overall  transparency as a new Alpha 1,  then does Solidify  C and finally would save tga with your script.   In such case your script  would only need a switchable option to keep existing Alpha1  when the script does  tga saving.

    ps. Photoshop7 didn't need Solidify at all. It just did basically same  for transparent pixels. In fact it was even better than Solidify  since it did better/smaller compressed textures.  Then Adobe issued a "bugfix" and killed the feature. Years after I am still puzzled why.

    I'll think about it, but it's a big change in the script as it is now.
    Right now it will just copy the contents from the _ALP layer comp into the alpha channel of the newly created texture.

    I don't duplicate the entire PSD (or only merged layers) and save that as a new file. For big PSD files this will take too much time.
    Like I said I want to keep the script very fast.
    I'll definitely have another thought about this, but I don't want to spend another 5 hours on the script, just for this feature only, cause for me it still sounds like a a difference in workflow.
    I've always used the extra manual step to create an alpha channel. I usually create a mask for my diffuse layer, and copy this mask to the alpha channel.
    This has always worked perfect for me, and once you're used to it, it's pretty fast as well.
  • gnoop
    Options
    Offline / Send Message
    gnoop polycounter
    I would record duplication and Solidify action parts by myself.  I meant that I only need an option in your script that would keep Alpha1   from   original .psd  when saves a tga , if no special _ALP layercomp appointed.   Just like regular tga saving dialog when it saves 32 bit .  Maybe one more suffix option in comp name?   I know very little about Photoshop scripting,  just hope it's not very hard to do.   If it is , no problem, the script is  already great  as it is. 

    One more thing. The script works ok only if I set an exact path to a  folder where .psd file is  in "Texture source folder root" .    It's not very convenient  to keep all textures  in same folder . I am accustomed to make sub-folders  for different asset subjects .  Have no idea if it's hard to fix either and could it find the file at least one level deeper for example.

     Nevertheless , your script is still the best  Photoshop thing  I had ever found . Better than all the recent  Adobe updates. Thanks a lot.   It worth to be bought by Adobe and incorporated to Photoshop permanently.
  • McSoftly
    Options
    Offline / Send Message
    McSoftly null
    Hi,
    This script looks really promising! Unfortunately I'm stuck with Photoshop CC 2017 and it seems to not work very well anymore. V.1 of your script works, but it changes the visibility of the groups after it saves the texture. So I can use it, I only have to run every script twice for it to save the correct group.

    V2. won't run at all on CC 2017.

    I'm really loathing CC 2017 btw.. seems to just be a huge bugfest all around :(
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    McSoftly said:
    Hi,
    This script looks really promising! Unfortunately I'm stuck with Photoshop CC 2017 and it seems to not work very well anymore. V.1 of your script works, but it changes the visibility of the groups after it saves the texture. So I can use it, I only have to run every script twice for it to save the correct group.

    V2. won't run at all on CC 2017.

    I'm really loathing CC 2017 btw.. seems to just be a huge bugfest all around :(
    I'm having a look at it right now. Thanks for the heads-up.
  • Perfect_Storm
    Options
    Offline / Send Message
    Perfect_Storm polycounter lvl 2
    gnoop said:
    One more thing. The script works ok only if I set an exact path to a  folder where .psd file is  in "Texture source folder root" .    It's not very convenient  to keep all textures  in same folder . I am accustomed to make sub-folders  for different asset subjects .  Have no idea if it's hard to fix either and could it find the file at least one level deeper for example.
    You can set the root folder here. So you can still work with sub-folders.
    Let's say your texture PSD is located in C :/Textures/Source/Props/Lamps
    You can now set your Texture Source folder Root to: C :/Textures/Source.
    Now you set set your Destination folder Root. Let's assume it is: D :/Textures

    The script will now export your texture to D :/Textures/Props/Lamps.

    In our studio we have an AssetsSource/Textures folder, and an Assets/Textures folder. All the sub-folders are automatically taken into consideration.
  • Justo
    Options
    Offline / Send Message
    Justo polycounter
    Tried today to install this script to Photoshop (21.1). When exporting out the maps, the names of the files read "undefined" at the beginning. So, if my PSD was named Peaches, and the suffix I input was _A, the exported map filename is "undefinedPeaches_A". 

    I don't see anything in the docs about this. Is this a Photoshop version compatibility issue, or am I doing something wrong?
Sign In or Register to comment.