Book Image

Maya Programming with Python Cookbook

By : Adrian Herbez
Book Image

Maya Programming with Python Cookbook

By: Adrian Herbez

Overview of this book

Maya is a 3D graphics and animation software, used to develop interactive 3D applications and games with stupendous visual effects. The Maya Programming with Python Cookbook is all about creating fast, powerful automation systems with minimum coding using Maya Python. With the help of insightful and essential recipes, this book will help you improve your modelling skills. Expand your development options and overcome scripting problems encountered whilst developing code in Maya. Right from the beginning, get solutions to complex development concerns faced when implementing as parts of build.
Table of Contents (17 chapters)
Maya Programming with Python Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Working with XML data


When grabbing data from a web server, it's highly likely that you'll receive it in a structured format of one kind or another, with XML and JSON being the most common options. In this example, we'll look at how to make use of data served up as XML.

Getting ready

To use this example, you'll need to have an XML file available on a server somewhere. The easiest way to do this is to create a file locally on your machine, then run the following:

python -m SimpleHTTPServer

From the same directory as the file, provide access to it via localhost. Here's the file that I'll be using as the example:

<xml version="1.0">
    <object type="cube">
        <x>0</x>
        <y>2</y>
        <z>3</z>
        <size>3</size>
    </object>

    <object type="sphere">
        <size>2</size>
        <x>0</x>
        <y>0</y>
        <z>0</z>
    </object>
</xml>

The...