# IRiTime Interface Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | StartFrame (void)
HRESULT | EndFrame (void)
HRESULT | Play ([in] BSTR bszAnimSpace)
HRESULT | Stop (void)
HRESULT | NextKeyFrame (void)
HRESULT | PrevKeyFrame (void)
HRESULT | NextFrame (void)
HRESULT | PrevFrame (void)
HRESULT | SetTime ([in] VARIANT time)
## Properties
VARIANT * | CurrentTime`[get]`
VARIANT * | AnimStart`[get]`
VARIANT * | EvalAnimStart ([in] BSTR bszAnimSpace)`[get]`
| evaluates start frame for animation space defined by parameter
VARIANT * | EvalAnimEnd ([in] BSTR bszAnimSpace)`[get]`
| evaluates end frame for animation space defined by parameter

## Detailed Description

The IRiTime interface provides functionality to access the current time of animation, start and stop playing the animation.

- We refer to time in a value for "frame".
- - if frames per second (fps) = 30
- - each frame = 33.3 milliseconds (1000/30)
- - 10.4 is a viable value: represents a sub-frame
- - 10.4 at 30fps = 10.4 * 33.3 = 346.67 milliseconds from very start of animation.
  Root-level name in the scripting engine's name space: RsTime

## Member Function Documentation

HRESULT IRiTime::StartFrame | ( | void |  | ) |

Moves current time to the begining of animation.

- Animation preferences (settings stack) Play Range: Start value.

        RsTime.StartFrame;

HRESULT IRiTime::EndFrame | ( | void |  | ) |

Sets current time to the end of animation.

- Animation preferences (settings stack)Play Range: End value.

        RsTime.EndFrame;

HRESULT IRiTime::Play | ( | [in] BSTR | bszAnimSpace | ) |

Plays animation from current time in specified anim clip.

Parameters:

  | bszAnimSpace | [in] Name of anim clip to be played.

        var owner = System.ThisOwner();
        var target = owner + '/Torus';
        var targetAnim = target + '/AnimClip';
        RsTime.Play(targetAnim);

HRESULT IRiTime::Stop | ( | void |  | ) |

Stops playing the animation.

        RsTime.Stop();

HRESULT IRiTime::NextKeyFrame | ( | void |  | ) |

Move to next keyframe in the animation.

        RsTime.NextKeyFrame();

HRESULT IRiTime::PrevKeyFrame | ( | void |  | ) |

Move to previous keyframe in the animation.

        RsTime.PrevKeyFrame();

HRESULT IRiTime::NextFrame | ( | void |  | ) |

Moves current time to the next frame.

        RsTime.NextFrame();

HRESULT IRiTime::PrevFrame | ( | void |  | ) |

Moves current time to the previous frame.

        RsTime.PrevFrame();

HRESULT IRiTime::SetTime | ( | [in] VARIANT | time | ) |

Sets new current time. In frame number value to move to.

Parameters:

  | time | [in] New current time

        RsTime.SetTime(120);

## Property Documentation

VARIANT* IRiTime::CurrentTime`[get]`

Returns the current time.

Returns:
  pVal [out, retval] Current time.

        var daTime = RsTime.CurrentTime();
        System.Alert(daTime);

VARIANT* IRiTime::AnimStart`[get]`

Get the Start time.

Returns:
  pStartTime [out, retval] Returns the start time.

Remarks:
  .

        var sTime = RsTime.AnimStart;

VARIANT* IRiTime::EvalAnimStart([in] BSTR bszAnimSpace)`[get]`

evaluates start frame for animation space defined by parameter

VARIANT* IRiTime::EvalAnimEnd([in] BSTR bszAnimSpace)`[get]`

evaluates end frame for animation space defined by parameter