Posts

Showing posts from December, 2013

PSD Metadata and Real time GUI updates.

Image
It might not be the absolute best solution, but I have been able to put into practice my idea of storing the tool settings in the PSD metadata, and it actually works pretty well. The current setup works like this: On export, go through a dictionary of controls inside the GUI and check the settings.  Store each object name and it's setting as a text block with easily splittable characters. For this I chose to use ~ and | as neither of these are used for windows file or directory names.  Write this text block to the PSD metadata.  Meanwhile, in the export, use the GUI's current settings to determine output locations, formats and files to include.   To reload the settings: A background thread is constantly listening for any changes in the current active Photoshop document.  If the name of the document changes, it automatically kicks off a function that reads the metadata out of the active PSD and splits it into objectName, setting value pairs.  If no data is f...

Texture Monkey... version"some big number"

Image
We are now getting Perforce. Oh how I  missed thee Perforce! And what a fantastic opportunity to revisit my favorite pet project, Texture Monkey! Be be honest, I'm kinda sick of re-writing this tool, but I've got it to a point where it meets a couple of extra prerequisites that it was sucking at before, mainly: It's written at a point where I actually feel I can competently write functional and readable code.   It's UI uses the QT framework. Which it MUCH nicer to work with than the previous WX.  It's been built around the premise that it  should easily be portable across projects without having to change any of the source code- provided afew assumptions about project structure are met.  It does more than texture exporting, and now supports Perforce integration as well.  Most importantly, it is written in a modular fashion, and can be expanded upon or cut back without too much trouble.  Now with extra stuff! Behind the scenes: It stores and loads tool ...

Writing Metadata to a PSD file using Python

Image
I want to save some tool specific information about a PSD file, but I don't want to have another pesky metadata file floating about to bloat my source texture folder. Luckily, the PSD file format supports writing custom MetaData within it, which is perfect for what I want to do. In this particular example, I want my tool to be able to remember which folder the flattened image associated with this PSD will eventually be put into, the format the image will be in and the resolution. There are many fields you can write to, but I have chosen to write to the Instructions information, because that just makes the most sense. Usually in Photoshop, you can see this fields available by going to the file info panel and going to the advanced tab: In Python, we can access and write to the PSD's metadata very easily. import win32com.client.dynamic as w32dynamic w32 = w32dynamic.Dispatch psApp = w32('Photoshop.Application') doc = psApp.activeDocument # When I pull this info out of the ...