Posts Tagged ‘tool’

Technical Art: Project 1 – Texture Selection Tool

Posted on: January 31st, 2013 by Adam No Comments

Class:
Technical Art

Assignment:

-Make a tool in Maya that queries texture file information from a specified folder.
-Tool MUST have a drop down menu to select between texture files
-Tool must have a button that applies texture from drop down menu to a selected mesh in the scene.
-Tool must have error handling.
-Code must be commented in such a way that someone who did not work on it could follow what you are doing.

Bonus Points:
Extra points will be awarded for extra or exemplary functionality added into the tool (that makes sense in the context of the tool).
Neat and organized tool UI will also net you a few extra points.

Description:

This was my first real Python script.  I had done a few small ones before for our other classes, but nothing like this, and nothing involving Maya’s GUI.  As such, there are certainly some parts that could be nicer, but I got all of the functionality that I wanted in there :D.  I pretty much went all out on this one.  As I said, this was my first big Python script, so I wanted to get my hands as dirty as I could.

The script allows users to select a folder (and optionally subfolders), and it displays images/movies that Maya can use as textures.  Users can select those files via a drop down, and preview them (and their image/video size) in the tool.  Users can then select objects in the scene, click a button that displays all of the materials applied to the selected objects, and choose which of those materials to apply the current texture to.  It’s very similar to the functionality already built in to Maya, but it has a few different features in there, and it was a fun exercise to introduce to Python 😀

You can download the tool here.