The below classes compare with the mel
The below classes have the ability to query both the internal units, and the ui units (except
Also see:
currentUnit
command.The below classes have the ability to query both the internal units, and the ui units (except
MTime
). The internal units, while they can be changed, usually shouldn't be. Defaults for internal units are:- Linear : Centimeters
- Angular : ? Mine comes up as
kInvalid
, which is odd. I'd expect it to be Radians though. - Time : Has no differentiation between internal\ui: There is only ui units. I think when Maya installs this is 24fps (film).
Linear:
OpenMaya.MDistanceimport maya.OpenMaya as om uiLinearUnit = om.MDistance.uiUnit()This returns an int value that corresponds to the
Unit
enum on the MDistance
class. Which corresponds to these constants:1 | kInches |
2 | kFeet |
3 | kYards |
4 | kMiles |
5 | kMillimeters |
6 | kCentimeters |
7 | kKilometers |
8 | kMeters |
Angular:
OpenMaya.MAngleimport maya.OpenMaya as om uiAngularUnit = om.MAngle.uiUnit()This returns an int value that corresponds to the
Unit
enum on the MAngle
class. Which corresponds to these constants:1 | kInvalid |
2 | kRadians |
3 | kDegrees |
4 | kAngMinutes |
5 | kAngSeconds |
6 | kLast |
Time:
OpenMaya.MTimeimport maya.OpenMaya as om uiTimeUnit = om.MTime.uiUnit()This returns an int value that corresponds to the
Unit
enum on the MTime
class. There are a lot of constant values, check the docs for the specifics.Also see: