Posts

Texture tools status(bar!)

Image
After a weekend of poking and prodding at my python scripts my pet project has made a decent amount of progress. Although I will admit, when looking at the screenshot it might not be readily apparent... What?! Two more buttons? Well done Pete! The two additional buttons are Alienbrain integration scripts to check out and check in the active PSD, as well as all it's exported TGA files. I also added a wx status bar so that the end user can get hints at how they may have broken the tool. Most of my time was spent working out a whole heap of things under the hood, like feeding back appropriate and consistent error/success messages, making sure that each of the scripts was well road tested and trying it out on a couple of different machines to make sure its portable. I've made sure that everything in the tool is referencing files and directories relative to it's own location. So far this has made installation on other machines quick and painless, so far anyway. Next up is the co...

Texture Tools

Image
I've embarked on my next little scripting adventure, and that is creating a unified toolset that combines all the Photoshop scripts I've written in python into a single handy tool. From left to right, Setup new document , Update Alpha , ExportTGA To facilitate this I have been using wxPython, and it's amazing how quickly you can get a working GUI up and running with it. I have already got the essential scripts integrated (NewDoc, UpdateAlpha, ExportTGA) and when I have time I will integrate the Alienbrain asset control scripts (CheckOut, CheckIn). Overall, planned features are:   One click document setup, including groups and base layers One click alpha updating from a source group One click asset exporting to defined project directories One click asset check out and check in using alienbrain.  User customizable project setup, including: Export locations Export formats Export file names  User customizable groups to include when setting up a new document. Most of these are...

MEL selection mask reference.

Sometimes the simplest things can be the most frustrating, especially when they don't work the way you expect them to. In this case, some selection masking in MEL wasn't doing what it was supposed to be doing (returning a previous selection in face mode) which was causing lots of frustration and beard scratching. That is until Christopher Crouze's post on Proper Selection Masks for Maya popped up on google search. Thanks Chris! 

Creating a new photoshop doc with Python, Part Two

Just a quick update on my previous post  about adding a new document to photoshop with python. It seems that Cs2 uses pixels as it's default assumed unit. Due to this, my script previously did not bother to define a unit type for the document and it all worked fine. I am running some tests of the script on Cs5 and coming up with some unexpected results- namely really massive documents, which are no fun. This is because the document is being made in CM by default rather than pixels.  To fix this, I added in this wee bit o'code: psApp.Preferences.RulerUnits = 1 Which defines the ruler units as pixels. The lesson... assume nothing! If it needs it, define it.

Learn Python the Hard Way

For anyone who is interested, I've found this book really helpful in picking up the python language. Learn Python The Hard Way contains a heap of useful programming advice delivered in a clear and very readable way. It progresses from very simple examples to more complex concepts with a learning curve that will always challenge, but doesn't ever put you in water too deep to fathom. Highly recommended to anyone aspiring to learn the basics of Python.

Python- Updating alpha from a group

I've tied the alpha updating to an action inside photoshop, and the results are pretty pleasing. Within the script there is a bit of juggling between active layers and active channels in order to get the action working properly. I also like to leave the user off in a place that makes sense- in this case, the alpha group, since its the one being updated.   The basics of this script: Checks for an 'alpha' group in the active PSD file. If present, copies it's merged contents to the alpha channel. ############################################################################## # # Photoshop alpha updater # (C) Pete Hanshaw, 2012 # http://peterhanshawart.blogspot.com.au/ # ############################################################################## # # Checks for an 'alpha' group in the active PSD file. If present, copies it's # contents to the alpha channel. # # Requires the Win32 Extensions: # http://python.net/crew/mhammond/win32/ # ########################...

Exporting texture Alpha from a group

While looking for a good Maya PitsNPeaks alternative, I have been tinkering with further scripts to improve artist texture workflow. One of the things I am working on is a neat little script that allows an artist to work on an image's alpha in a group named 'alpha' in the source PSD document, which is automatically copied over to the output file's alpha channel when it is exported, provided it is a texture that requires it (eg, an 'a' or 't' texture). The intention is that an artist will be able to edit and update the alpha channel as fluidly as any other texture map a material requires.