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

Sending POST data to a web server from Maya


So far, everything we've looked at involves pulling data from the Web into Maya. In this example, we'll look at how to send data to a server from within Maya.

There are two main ways to send data to a server—GET and POST. Using GET involves adding arguments onto a URL directly. It has the benefit of being able to be bookmarked (since the arguments are in the URL), but has limitations on the amount of data that can be sent. POST requests are more flexible and will usually be what you want to use to build tool pipelines in a production environment.

In this example, we'll implement two different examples of sending POST data. First, we'll look at sending summary data about a scene (the name of the file and the number of objects). Then, we'll look at using POST requests to send a selected model to a server as an OBJ file. This could form the backbone of an asset management pipeline.

Getting ready

We'll be using the requests library for this example, so...