Home Technical Talk

Photoshop texture exporter

Hey guys,

A friend of mine told me to post this script I made to ease your lifes while texturing in photoshop.

I created a script for photoshop that can export multiple .tga's with the right suffix and resolution from your .psd file. It utilizes the name and path of your psd.

For example, I have this .psd named TEX_MyTestObject, 2048x2048 with 3 folders in it, named Diffuse, Specular and Normals. When I run the script I get a dialogue where I select the Diffuse and Specular folder and set them to 50%. When I press ok it will take the Diffuse and specular folder seperatly and save them both on 1024 naming TEX_MyTestObject_D.tga and TEX_MyTestObject_S.tga in the same folder as my .psd within a few second.

This saved myself and other arists at playlogic a lot of time, because it completly automated the save as, the naming conventions and the resizing.


A Larger explanation can be found at my website
And you can download the scripts here

Critz and comments are welcome!

Cheers!

Mark Verkerk,

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    Cool!

    I added it to the wiki, along with the similar (but different!) vTools.
    http://wiki.polycount.net/2D_Software
  • DarthNater
    Options
    Offline / Send Message
    DarthNater polycounter lvl 10
    Great, now I can't name my textures anymore! That was the only part of texturing I was good at and you had to go and automate the process. What the hell were you thinking?

    Awesome script!
  • kdm3d
    Options
    Offline / Send Message
    any way to have a subfolder called "alpha" in the main folders and have that automatically export to the alpha channel of that map?
  • MR_Verkerk
    Options
    Offline / Send Message
    DarthNater: There is an option to use your Folder name as the suffix, just rename your layerSet (group) to "TestName" and add the parameter -n.
    The name should now look like this "TestName -n" when you export your layer it will automaticly be called NamePSD_TestName.tga

    kdm3d: If you add an alpha channel to you file, you will get a new checkbox when using the exporter, you can then select the layerSet that should be exporter with the alpha.

    (this only works when there is 1 alpha channel, in the case of more alpha channels. the script will become very bugged).

    I looked at using a group as an alpha before but were some problems with creating a alpha channel using a group, it didnt always work. if there are more people wanting this I will look into the matter. for now, convert your alpha group manually to the alpha channel :)


    Also there is 1 small problem with photoshop not finishing its scripts in case of an error. Normally the script will select a folder, resizes it for exporting, and then undoing the resize step. But I found a occasion that if photoshop gives an error message of any kind (memory for example) and your using the resizing option, it will not undo this because it stops the script! So if you are using the resize option, and photoshop fails, ALWAYS manually revert the resize command in your history!

    it only happened once to me though, and I cant make a failsafe, because its all photoshops failt to begin with :)
  • PredatorGSR
    Options
    Offline / Send Message
    PredatorGSR polycounter lvl 14
    Nice script. You can do something similar to this with Actions.

    Basically you can record an action of you saving out a TGA to a directory with certain settings, such as with an alpha or not and the directory. For the basic actions, I typically use 3 permanent actions that are set the F2, F3, and F4 hotkeys. The first time I save a file, I open the action pallete, double click on the action I want, and select the location to save, the file name, and the action. From then on, I just have to hit F2 to do the save operation. I usually do F2 for Diffuse, F3 for Specular, and F4 for normal. The nice thing is you can change any of them at any time.

    actions.jpg

    This especially comes in handy you are saving to DDS, because it will record your DDS settings and do it silently so you don't get the popup window.

    You can also record more complicated actions. For example, one that I used a ton at work was F5 did a copy merged and pasted it into a new document and flipped the channels to match our engine's normal map settings, F5 did a copy merged (with specular folder visible), and pasted the specular into the correct channel in the new document, and F6 did the same for the alpha channel. Then F4 to save the normal map with the proper settings.

    I don't think it was quite as powerful as the script you posted, but it had the advantage of being very flexible to match changing conditions and an artists workflow.

    It is really artist friendly, because you just hit 'record' and do the actions you want, and hit stop, and then tweak it if needed.
  • metalliandy
    Options
    Offline / Send Message
    metalliandy interpolator
    Awesome!
    Thanks for posting :D
  • DarthNater
    Options
    Offline / Send Message
    DarthNater polycounter lvl 10
    MR_Verkerk wrote: »
    DarthNater: There is an option to use your Folder name as the suffix, just rename your layerSet (group) to "TestName" and add the parameter -n.
    The name should now look like this "TestName -n" when you export your layer it will automaticly be called NamePSD_TestName.tga

    LOL I was just being a smart ass. It really is a good script!
  • MR_Verkerk
    Options
    Offline / Send Message
    Thanks for all the feedback:)

    PredatorGSR, its funny you actually mention the actions. I started out exactly like that, but I didnt like the lack of dynamics, such as the resize options ect. So I started experimenting with it, and I ended up with the script.

    For the guys who like to analize this sort of code, I hope I did a good job on making it clear, I have no experience in scripting or programming what so ever so im sorry if its a bit messy at some points :)

    If any of you guys have anything that can make a nice addition to the script, please tell me and i will try to make the script better!.

    Thanks again for the feedback:D
  • PolyHertz
    Options
    Offline / Send Message
    PolyHertz polycount lvl 666
    Bumping this old topic to see if anyone ever made an updated version since the resizing option no longer works in CS6.
  • timotronprime
    Options
    Offline / Send Message
    timotronprime polycounter lvl 11
    Not the same script but QSM supports what this does with the ability to add post-/pre-processing.

    http://felixschlitter.com/snippets/quick-save-maps#6
  • cptSwing
    Options
    Offline / Send Message
    cptSwing polycounter lvl 11
    I'm also a fan of actions built around Ariel Chai's qSave!
Sign In or Register to comment.