Tuesday, January 22, 2008

Maya Tip of the Day #3

Or maybe this is "MEL Tip of the Day #1." You be the judge.

So, I'm starting up a MEL scripting class through CGSociety. I'm pretty excited, though it will definitely take a small chunk out of my free time and slow down my work on this project. My hope, however, is that at the end of the class I've have a few more tools at my disposal that will speed up my work on the project as I come out the other side.

From time to time I'll try and post some MEL goodies and here is the first:


JEdit is a text editor, Java-based so it's platform agnostic and highly customizable. I played with it a little bit and liked it but I didn't love it. There was something about the Java feel that didn't sit right with me. I played with a couple others, namely TextMate and TextWrangler and found them decent enough but uninspiring (this is on OSX, so the biggies like Crimson Editor and MEL Studio Pro aren't in the running).

And then I kept crashing Maya. I'd type some code into TextWrangler, copy it, command-tab to Maya, paste it, run it, command-tab back into TextWrangler, type some code...rinse and repeat until Maya said "ENOUGH!" Maya does not like rapid-fire application switching.

...sigh...There's gotta be a way to execute code in Maya right from within a text editor, right? Right. And the right choice for that is JEdit. Remember how I said it was way customizable? I wasn't kidding. Following a blog post on Sean Nolan's site, I found a tutorial on highend3d written by a guy named Ron Bublitz, who is way, way too smart for me to really get a handle on. He wrote up a couple macros and a tutorial on how to configure JEdit to send your script into Maya and have it executed there. Seriously.

I even did it. I typed "polyCube" in JEdit, clicked a button in my toolbar and there was a little wireframe box in Maya. Magic. Will wonders never cease? Not at this rate.

Tip of the hat to Mr. Bublitz and JEdit and keep yer eyes peeled for more insane scripting action coming your way. I may even write some MEL that would make TWO little boxes appear in Maya! That would be something...

No comments: