Posts Tagged ‘API’

Problems with allNodeTypes Command

Thursday, December 31st, 2009

Oftentimes, when loading your own custom tool set, you may want to confirm the existence of a plug-in on the client machine in order to prevent weird errors. Specifically, if you create a tool that works with a custom node, you may want to verify the node’s existence using the allNodeTypes command. Unfortunately, this command has a really quirky problem when used in Python.
(more…)

Problems with MItSelectionList Filters

Monday, December 14th, 2009

One of the most common tools in the Maya API for custom commands is the MItSelectionList class. Part of the reason why it is so valuable is because it allows for an optional filter in its constructor using the MFn::Type enum. Applying a filter allows us to effectively ignore certain types of objects in which we are not interested, and conceivably to code with some amount of impunity since we know what the objects inside the iterator will be. Conceivably…
(more…)

Maya Python – The Book

Thursday, July 2nd, 2009

Well we have finally wrapped up development on Touch KO! The last few weeks have been hectic as we had some last-minute requirements sort of indirectly imposed on us by Apple, but everything is wrapped up and sent off to Chillingo.

One of my next projects is a book on the Maya Python API for Morgan Kaufmann (publisher of David Gould’s Complete Maya Programming texts). Ryan Trowbridge and I will be working on this together over the next year, so it is sure to be fun and exciting. We have a pretty comprehensive plan for what the book will cover, but please do feel free to contact either of us if there are specific things you would like to see!

In other news, Crane Wars, the newest Blurst game, was released a couple weeks ago. Among other things, I focused primarily on the characters in it. I did a post awhile ago that showed the facial rigs I created for them. Go play it now!

Crane Wars logo

Reading Individual Elements in an MMatrix in Maya Python

Tuesday, March 31st, 2009

How do you read individual elements in an MMatrix object in Maya Python? This is a problem that Ryan and I ran into about a year or so ago. Ryan brought this to the attention of an Autodesk developer at the time, who must have been misinformed and told us that it should work like C++. However, the following does not work:

# Create an MMatrix and print its first index
import maya.OpenMaya as OM
mat = OM.MMatrix()
print mat.matrix[0][0]

I was at Autodesk’s Maya API training last week during the GDC, and one of the trainers had run into this problem again. Unfortunately, she had also been misinformed by one of the developers as to how this should work. (more…)

Hip Constraint and Shoulder Constraint Update

Sunday, January 18th, 2009

Following in my pattern of frequent updates, I uploaded more revisions this morning to both the shoulder constraint and hip constraint.

The revision, which is the same in both, is another exception to handle a possible singularity. I never actually had it happen to me in practice, but I realized it was possible when I stopped to think about it. Enjoy!