Simple Maya script
Written by Samuel Rantaeskola, Product Expert, Simplygon
Disclaimer: The code in this post is written on version 10.3.5200 of Simplygon. Should you encounter this post running a different version, some of the API calls might differ. However, the core concepts should still remain valid.
Introduction
In this post, we'll guide you through using Simplygon's scripting support in Maya to transfer data from Maya to Simplygon, run a process, and bring the results back into Maya. This tutorial will provide a solid foundation for applying tips and tricks from other blogs directly within Maya.
Test asset
In our example, we'll use this ornate vase and reduce its poly count by 50%. The original asset contains 9,800 polygons:
Exporting
The first step is to export the asset from Maya so it can be processed in Simplygon. Below is a simple Python function that handles the export, using a temporary file to transfer the data:
Importing
Now, let's set things up to bring the processed results back into Maya once the process is complete. The following Python function imports the processed scene back into Maya:
String it all together
Now that we can export data from Maya and import it back, we have everything in place to process the asset. Below is the function that handles the processing:
Testing our scripts
With everything set up, we can now proceed to process our test asset. Here are the final results: