# MTime

## Constants

Name | Type | Description
--- | --- | ---
Unit Types
kInvalid | int | Invalid value
kHours | int | 3600 seconds
kMinutes | int | 60 seconds
kSeconds | int | 1 second
kMilliseconds | int | 1/1000 of a second
kGames | int | 15 frames per second
kFilm | int | 24 frames per second
kPALFrame | int | 25 frames per second
kNTSCFrame | int | 30 frames per second
kShowScan | int | twice film (48 frames per second)
kPALField | int | twice PAL (50 frames per second)
kNTSCField | int | twice NTSC (60 frames per second)
k2FPS | int | 2 frames per second
k3FPS | int | 3 frames per second
k4FPS | int | 4 frames per second
k5FPS | int | 5 frames per second
k6FPS | int | 6 frames per second
k8FPS | int | 8 frames per second
k10FPS | int | 10 frames per second
k12FPS | int | 12 frames per second
k16FPS | int | 16 frames per second
k20FPS | int | 20 frames per second
k40FPS | int | 40 frames per second
k75FPS | int | 75 frames per second
k80FPS | int | 80 frames per second
k100FPS | int | 100 frames per second
k120FPS | int | 120 frames per second
k125FPS | int | 125 frames per second
k150FPS | int | 150 frames per second
k200FPS | int | 200 frames per second
k240FPS | int | 240 frames per second
k250FPS | int | 250 frames per second
k300FPS | int | 300 frames per second
k375FPS | int | 375 frames per second
k400FPS | int | 400 frames per second
k500FPS | int | 500 frames per second
k600FPS | int | 600 frames per second
k750FPS | int | 750 frames per second
k1200FPS | int | 1200 frames per second
k1500FPS | int | 1500 frames per second
k2000FPS | int | 2000 frames per second
k3000FPS | int | 3000 frames per second
k6000FPS | int | 6000 frames per second
kUserDef | int | user defined (not implemented yet)
kLast | int | Last value, used for counting

## Static Methods

Name | Parameters | Returns | Description
--- | --- | --- | ---
uiUnit() |  | Unit Type constant | Returns the unit type currently used by Maya's UI to display time values.
setUIUnit(unit) | unit - Unit Type constant | None | Sets the unit type to be used by Maya's UI to display time values.

## Static Attributes

None.

## Constructors

Signature | Parameters | Description
--- | --- | ---
MTime() |  | Default constructor. Returns a new MTime object with value 1.0 and unit set to the current UI unit.
MTime(src) | src - MTime | Copy constructor. Returns a new MTime object with the same value and unit as src.
MTime(value, unit=kFilm) | value - float unit - Unit Type constant | Returns a new MTime object with the given value and unit.

## Object Methods

Signature | Parameters | Returns | Description
--- | --- | --- | ---
asUnits(unit) | unit - Unit Types constant | float | Returns the time value converted to the specified unit.

## Object Attributes

Name | Type | Access | Description
--- | --- | --- | ---
value | float | RW | Time value.
unit | Unit Type constant | RW | Units in which to interpret the value.

## Sequence Support

None.

## Number Support

Operation | Result
--- | ---
MTime = MTime + MTime | Addition of another time. Uses the units of the left operand.
MTime += MTime | In-place addition of another time. Retains the units of the left operand.
MTime = MTime + float | Addition of a float value. The value is interpreted in the units of the left operand.
MTime += float | In-place addition of a float value. The value is interpreted in the units of the left operand.
| MTime = MTime - MTime | Subtraction of another time. Uses the units of the left operand.
MTime -= MTime | In-place subtraction of another time. Retains the units of the left operand.
MTime = MTime - float | Subtraction of a float value. The value is interpreted in the units of the left operand.
MTime -= float | In-place subtraction of a float value. The value is interpreted in the units of the left operand.
MTime = MTime * float | Multiplication by a float value. The result uses the units of the left operand.
MTime *= float | In-place multiplication by a float value. The units of the left operand are retained.
MTime = MTime / float | Division by a float value. The result uses the units of the left operand.
MTime /= float | In-place division by a float value. The units of the left operand are retained.

## Comparison Support

All comparisons are supported.

Comparisons are done in a common unit, so comparisons of times using different units will give the expected results. For example, an MTime of 60 seconds will be equal to an MTime of one minute and less than an MTime of one hour.

© 2011 Autodesk, Inc. All rights reserved.