OpenMaya.MDistance Class Reference

OpenMaya.MDistance Class Reference

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

 


+ Inheritance diagram for OpenMaya.MDistance:

Public Member Functions

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

Static Public Member Functions

internalToUI ()
 
internalUnit ()
 
setUIUnit ()
 
uiToInternal ()
 
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
 
 value
 

Constructor & Destructor Documentation

OpenMaya.MDistance.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMaya.MDistance.__repr__ ( )
x.__repr__() <==> repr(x)
OpenMaya.MDistance.__str__ ( )
x.__str__() <==> str(x)
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
static
 Distance units currently in use.
Name: unit
Type: Unit type constant
Access: RW
Description: Units in which to interpret value.
OpenMaya.MDistance.value
static
 Value of the distance in the current units.
Name: value
Type: Float
Access: RW
Description: Raw distance value.