Growl for me!
June 9th, 2007
As a bleeding-heart Macophile at heart, I’ve become really intrigued with Growl notifications. Growl is a cool little system (similar to Twitter, I’ve been told) that allows applications and system events to display Caller ID style messages on your Mac.
My usual Maya workflow is Maya/3D work on my Win/Linux boxes, and my other work (coding, design, illustration, email, surfing… basically everything else) I do on my Macs. I was thinking it would be nice for Maya on any render machine to send a growl render notification to my main workstation, keeping me from having to bring various machines out of sleep / change KVM settings etc to see if batch renders have completed.
After a little bit of investigation, I discovered Netgrowl by Rui Carmo, which is a python framework for sending Growl notifications over a network.
In a leap of logic, I realized… Maya has Python integration now, but with a little bit of Googling I should be able to hack it to work. It took a little doing, as I’d never even touched Python before tonight, but I’ve got the foundation of a hack I’ll be building upon in the future, just because it’s so darned useful.
First, download th_mayarender_growler.py.
It should work with Mac, Win and Linux boxes, but I’m a complete n00b at Python, so be aware that there will be rough edges aplenty.
Open the file, and scroll down to the user config section (lines 12-15) and edit the following lines to match your environment:
#host name you want notifications to read from
thishostname = “HOSTNAMEFORTHISMACHINE”
#machine that you’re sending notifications to
growlee = “192.168.100.1″
#the app name that you want notifications to register under
regappname = “th_MayaRenderGrowler”
growleepassword = “yourgrowlnetpassword”
Then save the file under your Maya (version) scripts directory. I’ve heard reports that some people have to create a usersetup.py in order for python scripts to be used interchangeably with MEL, so check your docs first if you have trouble.
Once you’ve set up the script, you’ll need to make sure that the Growl preference pane is set up to allow incoming connections:

Once you’ve finished that, in the scene that you’re about to set to batch render, add the following Mel-to-Python hook in your render globals:

python(”import th_mayarender_growler”);
This being my first experience with Python, I’m sure the code will be an eyesore for anyone who does it professionally. I spent a little time trying to get functions working properly like global procs in MEL, but I ended up going the dirty route and just have the code executing on import.
The NetGrowl socket script is included with my code, so you won’t have to link libraries.
I suggest using sticky hovering window notifications, as my favorite (music video) won’t sticky and is of limited use if you walk away for a few minutes.
Once I get a little more comfy using the Mel-to-python glue, I’ll include options for frame-by-frame notification and clean up the functions and procedures.
If you’re of a mind, grab the code and start hacking away. I’d love to see what someone who’s competent at Python (ie not myself) can come up with.
1 Comment Add your own
1. Tom | June 30th, 2008 at 12:55 pm
I had some odd issues with ^M’s when I opened the zip on a linux box… which meant that the file got ruined when I ran dos2unix on it. Can you email me the raw text maybe?
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Subscribe to the comments via RSS Feed