View Full Version : XML, Python and Maya 8.5
itsenigma 04-27-2008, 07:15 PM Hello, am novice to Maya. I have Maya 8.5. I was trying to read an XML file in Maya using python scripting. Can any one help me in this issue. Any information online would also be great help.
Thanks.
/S
|
|
greatPumpkin
04-28-2008, 10:58 AM
try the elementTree module, IIRC it's part of the standard library in python 2.5
vScourge
04-28-2008, 12:05 PM
If you're after fairly specific pieces of data from the file, you may not need to actually parse the XML. You can use standard line-reading (with or without regular expressions) to get the job done. This is often faster and more memory-efficient than XML parsing.
Sometimes you really need to parse the XML, however, especially if you plan to write to it as well. For that, I usually use the minidom module, which (like elementtree) is part of the Python standard library.
I have examples of both approaches in the sample files from my "Python for Technical Artists" lecture, GDC 2008. The example scripts are in the "data mining" folder, and can be downloaded from our Volition GDC Archive (http://www.volition-inc.com/gdc).
Feel free to hit me with questions.
CGTalk Moderation
04-28-2008, 12:05 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.