Tuesday, January 20, 2015

Angle Measurement

Happy New Year!

Angular data, which will help with animating the ant I am working on, requires that I measure the angles between various components of the model. Maya, strangely, doesn't have a readily usable way to measure angles. There are a number of scripts out there, but I wanted to try my hand at creating a script that might be more functional and robust than some other solutions out there.



Measure Angle works with a quick mode and a UI mode (see the text file for some documentation). With UI mode, components and objects can be used to input world translate values. With quick mode, just select three objects, double-click the shelf button, and the angle is built.


Locators are placed in the scene which can then be constrained to objects to automatically update measurements. I thought it was important to have an annotation with the angle in the scene. The real trick was getting viewport text that would update continually. The result isn't perfect, but I believe it's fairly good. The annotation is driven by an expression, so it will update a) with a time change (scrub the timeline) b) if you hit the Refresh Annotations button or c) for constant updates, if the master node AE extra attributes is open (Copy Tab and minimize it).


There are some handy extra attributes (radians and degrees, visibility, and the extra updater angle value that helps keep the expression evaluating).

I'd be happy to hear some feedback on the script. I've only tested it on Maya 2015 Win x64, so other platforms would be good to hear about.

Later,
Stuart

1 comment: