March 07, 2008

XML Plugin updated with Maya 2008 binary

I just did a build of the XML plugin for Maya 2008. The zipfile now contains a binary for Maya 2008. The only caveat is that the 2008 binary hasn't been tested. I won't have access to 2008 until next week, so it may work, it may not.

March 01, 2008

XML Parsing Plugin

I finally have gotten around to packaging up the binaries for the XML parsing plugin. I finished it up two weeks ago but with GDC and then suffering through a cold the week after GDC, I've been too busy sleeping or trying to get caught up at work to get it packaged up and posted.

This plugin lets you load and save XML to and from MEL string variables and files. It's pretty permissive about the XML it will read. There are binaries for Maya 7.0, 8.0 and 8.5. Initially I was going to stop using this with 8.5 and move over to Python, but I find the Python/MEL integration so unwieldy that I use Python far less than I initially thought. So, I may be building a version for 2008 as well. I can probably build versions for earlier versions of Maya. I think I have access to 6.5 and 5.0 but I'll have to see.

Take a look at the documentation page and you can download the binaries from my MELScripts/Plugins page. I'll try to get the source code up in a reasonable time frame, but may be a couple of weeks.

Let me know of any comments, suggestions and bugs. One area I haven't used much is the data items. Pretty much all the XML I work with is all elements and attributes.

Enjoy.

February 12, 2008

Pardon the Interruption

Well, we were gone for a day or two. I forgot to renew my domain before the expiration, but it's taken care of now. Which you've probably figure out if you're reading this.

Trying to finish up the XML plugin and get it ready for posting. I've been using it for a little while and I just have a few rough edges to knock out. A few more days.

December 16, 2007

XML Parsing plugin for Maya

As it turns out, one of the most generally useful pieces of code I've written at work is an XML parser plugin. The studio uses XML for a variety of things: configuration files, asset storage and description, and also XML is stored in attributes on Maya nodes.

We had an XML parser library in C++ but nothing callable from MEL. The studio hadn't switched over to Python yet so there was no good solution. Before I got there, any functionality that needed to parse XML was either written in C++ (which means there are a number of tools written in C++ that should be MEL), or people just kind of did a rough grovel through the XML to extract what they needed and just hoped it worked.

Two or three weeks after I started (back in February or March of 2007), I spent a weekend wrapping the C++ XML library in a plugin. I took the design decision to make the interface look like the C++ methods and so I ended up with MEL commands like:


xmlGetNumChildren
xmlGetChild
xmlGetNumAttributes
xmlAppendAttribute
etc.

There are about twenty different commands. In hindsight this wasn't the right decision. While it's useful for people familiar with the XML parser, it's not very familiar to those native MEL speakers.

Even so, this has been very useful at work to a wide variety of people. So I decided I needed the same functionality at home, so I've been working on an XML parsing plugin in my spare time. I'm using Python some (both at work and at home) but haven't moved over completely so I think this will definitely get some use.

I found an XML parser by Frank Vanden Berghen to use and I've been writing a plugin in my spare time at home. It's given me a chance to correct the design flaw described above. Now there's just a handful of commands, one each for elements, attributes and data (plus a few utility functions for doing file I/O, etc). The commands support create, query and edit modes. A much better MEL-ish interface.

I'll be posting the plugin binaries plus the source and VS2005 project file in the next week or so. I've got a bit more work to do to finish it up along with some more testing.