IC8 Python API:RLPy RTime

From Reallusion Wiki!
Jump to: navigation, search

Description

This class represents the midst unit (a.k.a unit of time) in animation. Currently, it provides two states: milliseconds and 60FPS (frames per second). When you create an animation key, you'll need to set the value according to the incoming time. This class also provides different unit conversions such as GetFrameIndex, IndexedFrameTime, and GetFrameTime to ensure that the time retrieved is aligned with animation frames.

Constructor & Destructor

__init__ (self)

This operation creates a time object instance.

Member Functions

FromValue (tTick)

Creates a time value from the supplied underlying value.

Parameters

  • tTick

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToDouble (self)

Returns this time value as a double-precision number.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToFloat (self)

Returns this time value as a floating-point number.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToInt (self)

Returns this time value as an integer.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToInt64 (self)

Returns this time value as a 64-bit integer.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToLong (self)

Returns this time value as a long integer.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

ToUInt32 (self)

Returns this time value as an unsigned 32-bit integer.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__add__ (self, kTime)

The addition operator. Add two time objects together.

Parameters

  • kTime

Sample code

Calls `RLPy.RTime.__add__` with the inputs shown in the example.

def run_script():
    import RLPy
    # Addition operator
    time1 = RLPy.RTime(1000)
    time2 = RLPy.RTime(2000)
    time3 = time1 + time2
    print(time3)

__eq__ (self, kTime)

The "equal to" operator. Check if two time objects are equal.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__ge__ (self, kTime)

Reports whether this value is greater than or equal to another value.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__gt__ (self, kTime)

Reports whether this value is greater than another value.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__iadd__ (self, kTime)

Adds another value to this value in place.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__imul__ (self, tTimes)

Multiplies this value by another value in place.

Parameters

  • tTimes

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__isub__ (self, kTime)

Subtracts another value from this value in place.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__itruediv__ (self, *args)

Divides this value by another value in place.

Parameters

  • args

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__le__ (self, kTime)

Reports whether this value is less than or equal to another value.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__lt__ (self, kTime)

Reports whether this value is less than another value.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__mul__ (self, tTimes)

The "multiplication" operator. Multiply two time objects.

Parameters

  • tTimes

Sample code

Calls `RLPy.RTime.__mul__` with the inputs shown in the example.

def run_script():
    import RLPy
    # Multiplication operator
    time1 = RLPy.RTime(100.0)
    time2 = time1 * 0.5
    print(time2)

__ne__ (self, kTime)

The "not equal to" operator. Check if two time object are not equal.

Parameters

  • kTime

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__neg__ (self)

Returns the negated value.

Sample code

Demonstrates calls to `RLPy.RTime.FromValue`, `RLPy.RTime.ToDouble`, `RLPy.RTime.ToFloat`, `RLPy.RTime.ToInt`, `RLPy.RTime.ToInt64`, `RLPy.RTime.ToLong`, `RLPy.RTime.ToUInt32`, `RLPy.RTime.__eq__`, `RLPy.RTime.__ge__`, `RLPy.RTime.__gt__`, `RLPy.RTime.__iadd__`, `RLPy.RTime.__imul__`, `RLPy.RTime.__isub__`, `RLPy.RTime.__itruediv__`, `RLPy.RTime.__le__`, `RLPy.RTime.__lt__`, `RLPy.RTime.__ne__`, and `RLPy.RTime.__neg__` using the example's inputs.

import RLPy

def run_script():
    converted = RLPy.RTime.FromValue(1000)
    conversions = (
        RLPy.RTime.ToInt(converted),
        RLPy.RTime.ToInt64(converted),
        RLPy.RTime.ToLong(converted),
        RLPy.RTime.ToUInt32(converted),
        RLPy.RTime.ToFloat(converted),
        RLPy.RTime.ToDouble(converted),
    )
    first = RLPy.RTime()
    second = RLPy.RTime()
    equal = first == second
    not_equal = first != second
    less = first < second
    less_equal = first <= second
    greater = second > first
    greater_equal = second >= first
    first += second
    first *= 2.0
    first -= second
    first /= 2.0
    negative = -first
    return (conversions, equal, not_equal, less, less_equal, greater, greater_equal, first.ToInt(), negative.ToInt())

__sub__ (self, kTime)

The 'subtraction' operator. Minus a time object from another.

Parameters

  • kTime

Sample code

Calls `RLPy.RTime.__sub__` with the inputs shown in the example.

def run_script():
    import RLPy
    # Subtraction operator
    time1 = RLPy.RTime(1000)
    time2 = RLPy.RTime(2000)
    time3 = time2 - time1
    print(time3)

__truediv__ (self, *args)

The "division" operator. Divide two time objects.

Parameters

  • args

Sample code

Calls `RLPy.RTime.__truediv__` with the inputs shown in the example.

def run_script():
    import RLPy
    # Division operator
    time1 = RLPy.RTime(3000)
    time2 = time1 / 150
    print(time2)

Properties

thisown

Indicates whether this SWIG proxy owns the underlying C++ object.

Constants

HALF_MAXIMUM

HALF_MINIMUM

MAXIMUM

MINIMUM

NEGATIVE_ONE

ONE

ZERO