Posts

Creating and Removing Virtual Drives

Its Friday morning, the weekend is sparkling in front of you and you boot up your work computer only to find that something in the system has hiccuped and nuked all your virtual drive settings. Even if you don't have an environment batch file or what have you to save the day, it's an easy fix (as long as you know what the virtual drives were linking to!) Creating a Virtual Drive: 1-Work out what folder you want the drive to link to- eg: c:\projects\myProject\art\ 2-Open the command prompt 3-Type in: subst z: c:\projects\myProject\art\ Presto! z: now links directly to that folder! You can use any drive letter as an assignment as long as it is not currently in use by the system. Good candidates are x:, y: and z: drive letters. Removing Virtual drives... Oops... I made a mistake in my path and now it links to c:\whoops\this\is\wrong , and when I try to fix it it keep telling me 'Drive already SUBSTed' Once again, easy fix! To remove a virtual drive after it has been made, ...

PyMel- Getting texture file from a material

So, my first inelegant-yet-functional PyMel script is done and working. The core of it is in this little snippet here, that digs through a mesh's inputs until it finds the texture node on the surface shader: #Pass through the mesh's shape and return a texture name. import pymel as pm def getTextureFile(geo): sg = [] #Get the shading group from the selected mesh raw_sg = pm.listConnections(geo, type='shadingEngine') #Rapidly check for duplicates in the list- I do this by checking each item #against an empty list. #If the item is not in the empty list I append it. for element in raw_sg: if element not in sg: sg.append(element) #Get some info sgInfo = pm.listConnections(sg[0], type='materialInfo') fileNode = pm.listConnections(sgInfo[0], type='file') textureFile = pm.getAttr(fileNode[0].fileTextureName) print 'This is the file', str(textureFile) return str(textureFile) It st...

Getting Maya to talk to Photoshop

Sadly, at work I am not blessed with the latest and greatest Maya versions, and I have to be content with Maya 8.5. That also means I have to be content with Python 2.4.2 in Maya... eh. Its enough to do some cool stuff. It has been a little pet project of mine to get Photoshop and Maya to talk to each other and share texture information (like texture file locations, etc etc) and after a bit of fussing around, and a total failure to get comTypes to work (missing ctypes module in py 2.4) I have been able to get the win32com module to work within the Maya Python 2.4.2 scripting environment. I don't think its going to be a two way street, but it does mean I can open a model's source PSD file(s) in Photoshop from within Maya. Kinda a neat little workflow thing. If anyone wants to share a better method give me a shout! -Pete

Python, windows and easy install...

Hey peeps, been pretty busy through project crunch but thought I'd post something I found useful. If you are scripting with python on a regular basis and want to take advantage of additional modules you are eventually going to come up against the ironically named easy_install. I script in Python, why should I care about easy install?  That's an excellent question, me. Easy install, once set up, can automatically download and install modules on request from the command prompt. Just type in the name of the module you want and easy install will download and set it up for you. The only caveat is installing the installer, which presents all sorts of hiccups if you have never poked around at your system's environment variables before. If you are having any issues with getting it running on windows, this blog was of immense help to me. I gotta say, even with the pain of getting it set-up (wasn't so bad when explained well) its well worth it! -Pete --- Edit: I noticed that the...

Sketching

Image
Another photoshop sketch for the same environment as the gatehouse I did earlier...

Cupco Games

Image
Its awesome.  A couple of very talented former co-workers from Bluetongue have created their own indie studio called Cupco games  and have been very busy-bees (yeah, I had to do it)  working on their first iOS title- Splat Attack!   The game has been getting a good reception. If you are looking for a new iOS title (or even if you aren't!) Check them out ! 

Words.

Moving house is a pain, but its almost over, and I now have Internet. My ping might be 1576ms and the speed at something like 0.05Mbps but it's Internet 'damnnit! I've decided to go low(high?)tech and rather than setting up my usual cable broadband I've invested in a 3G mobile-broadband USB stick. So far I'm not totally impressed, but being able to browse the internet on the train is kinda cool. Even if it is at speeds approaching ye-olde dial-up from the wrong side. The sales team promised me "Something kinda around ADSL1 speeds" with emphasis on the something and the kinda . Those awkward pauses during the sales pitch are starting to make sense now... Anyway, talking of the internet, if anyone is interested in making their Python scripts talk to the web (or at least read the web) I totally recommend checking out the built in urllib2 and the beautifulsoup modules. I've started poking around with them and writing some  screen-scraping  scripts and so f...