archive
Category : Python

thumb

Unit-testing, the dark art

Categories: Python
Comments: 2 Comments
Published on: April 28, 2011

You may have heard about unittests in the past, and most likely, like myself, didn’t really know what they were or why you would want to use them. Even if you talked with someone who did use them and loved ’em, they still had a difficult time explaining what they really were. Well I’ll do[…]

thumb

Maya Environment

Categories: Maya, PyMEL, Python
Tags: ,
Comments: 13 Comments
Published on: March 30, 2011

One of the first things to check when a (python) script is not loading or importing properly is your *pythonpath* environment variable. This is because Python modules are VERY dependent on path location. So if you ever get an error that says something like this: or then you better check your pythonpaths by using simple[…]

thumb

Wing/Maya Remote Debug Setup

Categories: IDE, Maya, Python
Comments: 12 Comments
Published on: March 28, 2011

There are some great posts and pages explaining how to setup Wing IDE to remotely debug a Maya session. Eric Pavey first posted how to do this at his WarpCat Blog along with how to send commands back and forth to Maya from Wing. Luckily, now, many of us are starting to use this workflow[…]

thumb

Power Python for Maya Development – GDC 2011

Categories: IDE, Maya, PyMEL, Python
Tags: , , , ,
Comments: 8 Comments
Published on: March 7, 2011

Do you ask yourself any of these questions? a). Ever wonder what the big deal is with Python vs. MEL? b). What is all of this Python Classing and PyMEL nonsense? c). Why go to the trouble of using a complicated IDE? The answers are in my talk from GDC last week. Hope it helps[…]

thumb

@deprecated Decorator

Categories: PyMEL, Python
Tags: ,
Comments: No Comments
Published on: December 18, 2010

Turns out that I’m always, repeat, always re-writing, and re-organizing my code. If you’re like me, you’ll want to leave your old functions or classes & methods in place while you re-write or move them. Then you’ll want to leave little tags everywhere there is an old call to one of these. Seth Gibson (@voMethod on Twitter)[…]

thumb

Python @staticmethod and @classmethod

Categories: Python
Tags:
Comments: No Comments
Published on: December 10, 2010

(Lifted from Didip Kerabat’s blog HERE) Unlike Java, where static method and class method are the same thing, in Python there is subtle difference: Say function a() is defined in Parent Class, while Sub Class extends Parent Class If function a() has @staticmethod decorator, Sub.a() still refers to definition inside Parent Class. Whereas, If function a() has @classmethod decorator, Sub.a()[…]

thumb

Remote Maya Python Debugging in Eclipse

Categories: IDE, Python
Comments: 15 Comments
Published on: November 8, 2010

PyDev has debugger: Turns out Pydev has a nice plugin/package calling the module pydevd.py. Instructions on generic usage are here: http://pydev.org/manual_adv_remote_debugger.html When we say remote, it doesn’t have to be on another computer, it can be on your own computer, it is just debugging a script that is not being run from within your Eclipse[…]

thumb

Maya Python API example

Categories: Python
Comments: No Comments
Published on: January 31, 2010

So I had to re-write our exporter the other day. Needing to optimize the vertex iterator, I decided it was a good time to push into Maya’s Python wrapped API, ‘cept the examples available are practically nil. Until I found Chad’s awesome script: http://www.chadvernon.com/blog/downloads/cvxporter/ Made for the directX schema, he still has awesome examples of[…]

thumb

Regular Expression helpers

Categories: Python
Tags: No Tags
Comments: No Comments
Published on: January 31, 2010

    Regular expressions seemed very daunting for a long time. Several times I’d commit and give it a go and try to understand them, to no avail. Finally, one day, it clicked, sort of, and I finally got them to work the way I wanted them to. Mainly it was using tools like these:[…]

Welcome , today is Wednesday, December 12, 2018