Showing posts with label [MEL]. Show all posts
Showing posts with label [MEL]. Show all posts

Thursday, October 20, 2011

[MEL] Mirror On Pivot Tool


(Code can be found in Scripts)

An oddly specific modeling tool but I don't know why I never made it before now, seeing as I've thought to myself many times that it would be great  and much more accurate than duplicating and moving a mesh.

This simple tool came about when a member of my team needed to mirror a mesh from its pivot after he had UV'd it, essentially cutting his work in half on many of his props.  The old way he would have done this was by duplicating the mesh and repositioning it to where he needed but just trying to match it by eye. With this tool it does it much more accurately and much faster (at the click of a single button!).

This tool gives the option to Mirror On Pivot via x,y, or z axis.


[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.