OpenMaya.MTime Class Reference

Class Description

Manipulate time data.

Constructors

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

Number Support

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

 


+ Inheritance diagram for OpenMaya.MTime:

Public Member Functions

__add__ ()
 
__div__ ()
 
__eq__ ()
 
__ge__ ()
 
__gt__ ()
 
__iadd__ ()
 
__idiv__ ()
 
__imul__ ()
 
__init__ ()
 
__isub__ ()
 
__le__ ()
 
__lt__ ()
 
__mul__ ()
 
__ne__ ()
 
__radd__ ()
 
__rdiv__ ()
 
__repr__ ()
 
__rmul__ ()
 
__rsub__ ()
 
__str__ ()
 
__sub__ ()
 
asUnits ()
 

Static Public Member Functions

setUIUnit ()
 
ticksPerSecond ()
 
uiUnit ()
 

Static Public Attributes

int k15FPS = 5
 
int k23_976FPS = 43
 
int k24FPS = 6
 
int k25FPS = 7
 
int k29_97DF = 45
 
int k29_97FPS = 44
 
int k30FPS = 8
 
int k44100FPS = 48
 
int k47_952FPS = 46
 
int k48000FPS = 49
 
int k48FPS = 9
 
int k50FPS = 10
 
int k59_94FPS = 47
 
int k60FPS = 11
 
Unit Types
int k100FPS = 25
 
int k10FPS = 18
 
int k1200FPS = 38
 
int k120FPS = 26
 
int k125FPS = 27
 
int k12FPS = 19
 
int k1500FPS = 39
 
int k150FPS = 28
 
int k16FPS = 20
 
int k2000FPS = 40
 
int k200FPS = 29
 
int k20FPS = 21
 
int k240FPS = 30
 
int k250FPS = 31
 
int k2FPS = 12
 
int k3000FPS = 41
 
int k300FPS = 32
 
int k375FPS = 33
 
int k3FPS = 13
 
int k400FPS = 34
 
int k40FPS = 22
 
int k4FPS = 14
 
int k500FPS = 35
 
int k5FPS = 15
 
int k6000FPS = 42
 
int k600FPS = 36
 
int k6FPS = 16
 
int k750FPS = 37
 
int k75FPS = 23
 
int k80FPS = 24
 
int k8FPS = 17
 
int kFilm = 6
 
int kGames = 5
 
int kHours = 1
 
int kInvalid = 0
 
int kLast = 51
 
int kMilliseconds = 4
 
int kMinutes = 2
 
int kNTSCField = 11
 
int kNTSCFrame = 8
 
int kPALField = 10
 
int kPALFrame = 7
 
int kSeconds = 3
 
int kShowScan = 9
 
int kUserDef = 50
 

Properties

 unit
 
 value
 

Constructor & Destructor Documentation

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

Member Function Documentation

OpenMaya.MTime.__add__ ( )
x.__add__(y) <==> x+y
OpenMaya.MTime.__div__ ( )
x.__div__(y) <==> x/y
OpenMaya.MTime.__eq__ ( )
x.__eq__(y) <==> x==y
OpenMaya.MTime.__ge__ ( )
x.__ge__(y) <==> x>=y
OpenMaya.MTime.__gt__ ( )
x.__gt__(y) <==> x>y
OpenMaya.MTime.__iadd__ ( )
x.__iadd__(y) <==> x+=y
OpenMaya.MTime.__idiv__ ( )
x.__idiv__(y) <==> x/=y
OpenMaya.MTime.__imul__ ( )
x.__imul__(y) <==> x*=y
OpenMaya.MTime.__isub__ ( )
x.__isub__(y) <==> x-=y
OpenMaya.MTime.__le__ ( )
x.__le__(y) <==> x<=y
OpenMaya.MTime.__lt__ ( )
x.__lt__(y) <==> x<y
OpenMaya.MTime.__mul__ ( )
x.__mul__(y) <==> x*y
OpenMaya.MTime.__ne__ ( )
x.__ne__(y) <==> x!=y
OpenMaya.MTime.__radd__ ( )
x.__radd__(y) <==> y+x
OpenMaya.MTime.__rdiv__ ( )
x.__rdiv__(y) <==> y/x
OpenMaya.MTime.__repr__ ( )
x.__repr__() <==> repr(x)
OpenMaya.MTime.__rmul__ ( )
x.__rmul__(y) <==> y*x
OpenMaya.MTime.__rsub__ ( )
x.__rsub__(y) <==> y-x
OpenMaya.MTime.__str__ ( )
x.__str__() <==> str(x)
OpenMaya.MTime.__sub__ ( )
x.__sub__(y) <==> x-y
OpenMaya.MTime.asUnits ( )
Return the time value, converted to the specified units.
Signature: asUnits(unit)
Parameters: unit - Unit Types constant
Returns: float
Description: Returns the time value converted to the specified unit.
OpenMaya.MTime.setUIUnit ( )
static
Change the units used to display time in Maya's UI.
Name: setUIUnit(unit)
Parameters: unit - Unit Type constant
Returns: None
Description: Sets the unit type to be used by Maya's UI to display time values.
OpenMaya.MTime.ticksPerSecond ( )
static
Returns the number of ticks per second, the smallest unit of time available.
OpenMaya.MTime.uiUnit ( )
static
Return the units used to display time in Maya's UI.
Name: uiUnit()
Parameters:  
Returns: Unit Type constant
Description: Returns the unit type currently used by Maya's UI to display time values.

Member Data Documentation

OpenMaya.MTime.k100FPS = 25
static
Name: k100FPS
Type: int
Description: 100 frames per second
OpenMaya.MTime.k10FPS = 18
static
Name: k10FPS
Type: int
Description: 10 frames per second
OpenMaya.MTime.k1200FPS = 38
static
Name: k1200FPS
Type: int
Description: 1200 frames per second
OpenMaya.MTime.k120FPS = 26
static
Name: k120FPS
Type: int
Description: 120 frames per second
OpenMaya.MTime.k125FPS = 27
static
Name: k125FPS
Type: int
Description: 125 frames per second
OpenMaya.MTime.k12FPS = 19
static
Name: k12FPS
Type: int
Description: 12 frames per second
OpenMaya.MTime.k1500FPS = 39
static
Name: k1500FPS
Type: int
Description: 1500 frames per second
OpenMaya.MTime.k150FPS = 28
static
Name: k150FPS
Type: int
Description: 150 frames per second
OpenMaya.MTime.k16FPS = 20
static
Name: k16FPS
Type: int
Description: 16 frames per second
OpenMaya.MTime.k2000FPS = 40
static
Name: k2000FPS
Type: int
Description: 2000 frames per second
OpenMaya.MTime.k200FPS = 29
static
Name: k200FPS
Type: int
Description: 200 frames per second
OpenMaya.MTime.k20FPS = 21
static
Name: k20FPS
Type: int
Description: 20 frames per second
OpenMaya.MTime.k240FPS = 30
static
Name: k240FPS
Type: int
Description: 240 frames per second
OpenMaya.MTime.k250FPS = 31
static
Name: k250FPS
Type: int
Description: 250 frames per second
OpenMaya.MTime.k2FPS = 12
static
Name: k2FPS
Type: int
Description: 2 frames per second
OpenMaya.MTime.k3000FPS = 41
static
Name: k3000FPS
Type: int
Description: 3000 frames per second
OpenMaya.MTime.k300FPS = 32
static
Name: k300FPS
Type: int
Description: 300 frames per second
OpenMaya.MTime.k375FPS = 33
static
Name: k375FPS
Type: int
Description: 375 frames per second
OpenMaya.MTime.k3FPS = 13
static
Name: k3FPS
Type: int
Description: 3 frames per second
OpenMaya.MTime.k400FPS = 34
static
Name: k400FPS
Type: int
Description: 400 frames per second
OpenMaya.MTime.k40FPS = 22
static
Name: k40FPS
Type: int
Description: 40 frames per second
OpenMaya.MTime.k4FPS = 14
static
Name: k4FPS
Type: int
Description: 4 frames per second
OpenMaya.MTime.k500FPS = 35
static
Name: k500FPS
Type: int
Description: 500 frames per second
OpenMaya.MTime.k5FPS = 15
static
Name: k5FPS
Type: int
Description: 5 frames per second
OpenMaya.MTime.k6000FPS = 42
static
Name: k6000FPS
Type: int
Description: 6000 frames per second
OpenMaya.MTime.k600FPS = 36
static
Name: k600FPS
Type: int
Description: 600 frames per second
OpenMaya.MTime.k6FPS = 16
static
Name: k6FPS
Type: int
Description: 6 frames per second
OpenMaya.MTime.k750FPS = 37
static
Name: k750FPS
Type: int
Description: 750 frames per second
OpenMaya.MTime.k75FPS = 23
static
Name: k75FPS
Type: int
Description: 75 frames per second
OpenMaya.MTime.k80FPS = 24
static
Name: k80FPS
Type: int
Description: 80 frames per second
OpenMaya.MTime.k8FPS = 17
static
Name: k8FPS
Type: int
Description: 8 frames per second
OpenMaya.MTime.kFilm = 6
static
Name: kFilm
Type: int
Description: 24 frames per second
OpenMaya.MTime.kGames = 5
static
Name: kGames
Type: int
Description: 15 frames per second
OpenMaya.MTime.kHours = 1
static
Name: kHours
Type: int
Description: 3600 seconds
OpenMaya.MTime.kInvalid = 0
static
Name: kInvalid
Type: int
Description: Invalid value
OpenMaya.MTime.kLast = 51
static
Name: kLast
Type: int
Description: Last value, used for counting
OpenMaya.MTime.kMilliseconds = 4
static
Name: kMilliseconds
Type: int
Description: 1/1000 of a second
OpenMaya.MTime.kMinutes = 2
static
Name: kMinutes
Type: int
Description: 60 seconds
OpenMaya.MTime.kNTSCField = 11
static
Name: kNTSCField
Type: int
Description: twice NTSC (60 frames per second)
OpenMaya.MTime.kNTSCFrame = 8
static
Name: kNTSCFrame
Type: int
Description: 30 frames per second
OpenMaya.MTime.kPALField = 10
static
Name: kPALField
Type: int
Description: twice PAL (50 frames per second)
OpenMaya.MTime.kPALFrame = 7
static
Name: kPALFrame
Type: int
Description: 25 frames per second
OpenMaya.MTime.kSeconds = 3
static
Name: kSeconds
Type: int
Description: 1 second
OpenMaya.MTime.kShowScan = 9
static
Name: kShowScan
Type: int
Description: twice film (48 frames per second)
OpenMaya.MTime.kUserDef = 50
static
Name: kUserDef
Type: int
Description: user defined (not implemented yet)

Property Documentation

OpenMaya.MTime.unit
static
 Time units currently in use.
Name: unit
Type: Unit Type constant
Access: RW
Description: Units in which to interpret the value.
OpenMaya.MTime.value
static
 Value of the time in the current units.
Name: value
Type: float
Access: RW
Description: Time value.