Thursday, October 20, 2011

[MEL] Export Prepare Tool

As my first post I feel I should introduce myself briefly! I am Thomas Trently, a Junior at Ringling College of Art and Design and I aspire to be a Tech Artist. This blog will be used to document tools and my thought process through their creation.

Diving right into things the first MEL script I wrote was a simple macro to help improve my teammates and my own workflow of exporting meshes from Maya into UDK. Since we are constantly working on props (taking them back and forth between Maya and the Engine making tweaks), taking the time to make sure we freeze transforms, delete history, and center it in Mayas world space to have a correct pivot in UDK can eat up a lot of it. It has definitely shaved a lot of time from mine and my teammates workflow.
 

[MEL]

makeIdentity -apply true -t 1 -r 1 -s 1 -n 0;
$Pos = `xform -q -piv -ws`;
move -a (-1 * $Pos[0]) (-1 * $Pos[1]) (-1 * $Pos[2]);
DeleteHistory;


Right now the way this script works is when you use it on a mesh it will center the pivot to the world space, freeze transformations and delete history preparing it to be exported.

In the near future I would like to add the ability for it to open an Export Dialog after it completes the tasks mentioned as well as add the ability to snap the pivot to a selected vertex before centering it to the world. This would be useful so that if the pivot isn't set you can quickly select a vertex you'd like the pivot to be at and it would automatically snap to it before completing the other tasks. Mainly for use with modular kits.

No comments:

Post a Comment