Python API 2.0 Reference
OpenMaya.MDistance Class Reference
+ Inheritance diagram for OpenMaya.MDistance:

Public Member Functions

def __init__ ()
 
def __repr__ ()
 
def __str__ ()
 
def asCentimeters ()
 
def asFeet ()
 
def asInches ()
 
def asKilometers ()
 
def asMeters ()
 
def asMiles ()
 
def asMillimeters ()
 
def asUnits ()
 
def asYards ()
 

Static Public Member Functions

def __new__ ()
 
def internalToUI ()
 
def internalUnit ()
 
def setUIUnit ()
 
def uiToInternal ()
 
def uiUnit ()
 

Static Public Attributes

Unit Types
int kCentimeters = 6
 
int kFeet = 2
 
int kInches = 1
 
int kInvalid = 0
 
int kKilometers = 7
 
int kLast = 9
 
int kMeters = 8
 
int kMiles = 4
 
int kMillimeters = 5
 
int kYards = 3
 

Properties

 unit = property(...)
 
 value = property(...)
 

Detailed Description

Manipulate distance data.

Constructors

SignatureParametersDescription
MDistance()  

Default constructor. Returns a new MDistance with a value of 0.0 centimeters.

MDistance(src) src - MDistance

Copy constructor. Returns a new MDistance with the same value and unit type as src.

MDistance(value, unit=kCentimeters) value - Float
unit - Unit type constant

Returns a new MDistance using the given value and unit.

 


Constructor & Destructor Documentation

def OpenMaya.MDistance.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMaya.MDistance.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
def OpenMaya.MDistance.__repr__ ( )
Return repr(self).
def OpenMaya.MDistance.__str__ ( )
Return str(self).
OpenMaya.MDistance.asCentimeters ( )
Return the distance value, converted to centimeters.
Signature: asCentimeters()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to centimeters.
OpenMaya.MDistance.asFeet ( )
Return the distance value, converted to feet.
Signature: asFeet()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to feet.
OpenMaya.MDistance.asInches ( )
Return the distance value, converted to inches.
Signature: asInches()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to inches.
OpenMaya.MDistance.asKilometers ( )
Return the distance value, converted to kilometers.
Signature: asKilometers()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to kilometers.
OpenMaya.MDistance.asMeters ( )
Return the distance value, converted to meters.
Signature: asMeters()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to meters.
OpenMaya.MDistance.asMiles ( )
Return the distance value, converted to miles.
Signature: asMiles()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to miles.
OpenMaya.MDistance.asMillimeters ( )
Return the distance value, converted to millimeters.
Signature: asMillimeters()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to millimeters.
OpenMaya.MDistance.asUnits ( )
Return the distance value, converted to the specified units.
Signature: asUnits(unit)
Parameters: unit - Unit type constant
Returns: Float
Description: Returns the distance value, converted to the specified unit.
OpenMaya.MDistance.asYards ( )
Return the distance value, converted to yards.
Signature: asYards()
Parameters:  
Returns: Float
Description: Returns the distance value, converted to yards.
OpenMaya.MDistance.internalToUI ( )
static
Convert a value from Maya's internal units to the units used in the UI.
Name: internalToUI(internalValue)
Parameters: internalValue - Float
Returns: Float
Description: Interprets internalValue as a distance in Maya's internal units and returns it converted to UI units.
OpenMaya.MDistance.internalUnit ( )
static
Return the distance unit used internally by Maya.
Name: internalUnit()
Parameters:  
Returns: Unit type constant.
Description: Returns the type of units in which Maya stores distance values internally (e.g. in plugs and binary file formats).
OpenMaya.MDistance.setUIUnit ( )
static
Change the units used to display distances in Maya's UI.
Name: setUIUnit(newUnit)
Parameters: newUnit - unit type constant
Returns: None
Description: Sets the type of units to be used to enter and display distances in Maya's UI
OpenMaya.MDistance.uiToInternal ( )
static
Convert a value from the units used in the UI to Maya's internal units.
Name: uiToInternal(uiValue)
Parameters: uiValue - Float
Returns: Float
Description: Interprets uiValue as a distance in Maya's UI units and returns it converted to internal units.
OpenMaya.MDistance.uiUnit ( )
static
Return the units used to display distances in Maya's UI.
Name: uiUnit()
Parameters:  
Returns: Unit type constant.
Description: Returns the type of units currently being used to enter and display distances in Maya's UI.

Member Data Documentation

OpenMaya.MDistance.kCentimeters = 6
static
Name: kCentimeters
Type: Int
Description:  
OpenMaya.MDistance.kFeet = 2
static
Name: kFeet
Type: Int
Description:  
OpenMaya.MDistance.kInches = 1
static
Name: kInches
Type: Int
Description:  
OpenMaya.MDistance.kInvalid = 0
static
Name: kInvalid
Type: Int
Description:  
OpenMaya.MDistance.kKilometers = 7
static
Name: kKilometers
Type: Int
Description:  
OpenMaya.MDistance.kLast = 9
static
Name: kLast
Type: Int
Description:  
OpenMaya.MDistance.kMeters = 8
static
Name: kMeters
Type: Int
Description:  
OpenMaya.MDistance.kMiles = 4
static
Name: kMiles
Type: Int
Description:  
OpenMaya.MDistance.kMillimeters = 5
static
Name: kMillimeters
Type: Int
Description:  
OpenMaya.MDistance.kYards = 3
static
Name: kYards
Type: Int
Description:  

Property Documentation

OpenMaya.MDistance.unit = property(...)
static
 Distance units currently in use.
Name: unit
Type: Unit type constant
Access: RW
Description: Units in which to interpret value.
OpenMaya.MDistance.value = property(...)
static
 Value of the distance in the current units.
Name: value
Type: Float
Access: RW
Description: Raw distance value.