View Full Version : MEL scale operation

09 September 2010, 05:35 AM

I need to scale a selected face. I need, however, for the scale axis to be aligned with one of the edges of the face. Within the scale tool settings of the Maya GUI, you are able to set the scale axis using a "Set to Edge" operation. This works perfectly. I need a MEL version of this operation though.

manipScaleAlignHandleWith($edge, {$face});
The above code does the job of automating the "set to Edge" part, however a scale proc within MEL totally ignores the fact that the scale tool has had a scale axis set.

Question: How do I scale with the scale pivot "set to Edge" within MEL?


09 September 2010, 10:34 AM
I was under the impression that Autodesk had "fixed" this whole local rotate/scale axis issue in Maya 2011, but if they haven't, or you're using an older version (like me :sad: ) you may have to use a slightly more low-fi solution.

I wrote this bit of MEL code that helps me (attached). If you select an edge and a face together then run it, it creates a locator that is positioned on the edge center and aligned to the edge and face normal. Once you have this you can parent anything to it and then rotate/scale the locator to locally affect everything underneath it. To do the same to components, simply convert the components to vertices (CTRL-F9) then cluster them. parent the cluster to the aligned locator and you're all set.

If that's still a bit too much manual work, Henry Korol made a pretty good (by all accounts) scripted solution which you can check out here:

which does all sorts of axis-related stuff. I'm not sure if it's still in development or supported though as it's pretty old...


09 September 2010, 11:26 AM
localTools is great! but quite a bloat to my taste.. I mean I don't get what he is doing there but its cool that way :]

His website though is under construction for quite some time now, huh? :D

CGTalk Moderation
09 September 2010, 11:26 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.