Skip to content

niKeyframeController⚓︎

The controller responsible for animating transforms, using position, rotation, and scale keys.

This type inherits the following: niTimeController, niObject

Properties⚓︎

active⚓︎

If the controller is active. When inactive, the target does not get updated and animation timing does not advance.

Returns:

  • result (boolean)

animTimingType⚓︎

How the time parameter passed to the update function is treated. Type 0 is the default, which treats the update time as a delta time. Type 1 treats the update time an offset from the start of the animation.

Maps to values in ni.animType table.

Returns:


cycleType⚓︎

The animation cycle type. Type 0 is looping, type 2 is reverse, type 4 is clamped.

Maps to values in ni.animCycleType table.

Returns:


data⚓︎

Read-only. The keyframe data used by the controller.

Returns:


frequency⚓︎

The animation controller's frequency value. It is a scaling value used to convert from update time units to keyframe time units, if necessary.

Returns:

  • result (number)

highKeyFrame⚓︎

This is the end animation key time of the animation controller.

Returns:

  • result (number)

lastScaledTime⚓︎

This function returns the last scaled time computed by this controller. The scaled time takes the frequency and phase into account, along with the cycleType and animTimingType. This is the last value used to interpolate animation keys.

Returns:

  • result (number)

lastTime⚓︎

No description.

Returns:

  • result (number)

lastUsedPositionIndex⚓︎

The last position index that the game engine used.

Returns:

  • result (number)

lastUsedRotationIndex⚓︎

The last rotation index that the game engine used.

Returns:

  • result (number)

lastUsedScaleIndex⚓︎

The last scale index that the game engine used.

Returns:

  • result (number)

lowKeyFrame⚓︎

This is the beginning animation key time of the animation controller.

Returns:

  • result (number)

nextController⚓︎

The next animation controller in the list of controllers containing the calling controller.

Returns:


phase⚓︎

The phase value. It is an offset applied to the animation's update time, in seconds.

Returns:

  • result (number)

refCount⚓︎

Read-only. The number of references that exist for this object. When this value reaches zero, the object will be deleted.

Returns:

  • result (number)

RTTI⚓︎

Read-only. The runtime type information for this object. This is an alias for the .runTimeTypeInformation property.

Returns:


runTimeTypeInformation⚓︎

Read-only. The runtime type information for this object.

Returns:


startTime⚓︎

The time at which the animation controller starts playing its animation.

Returns:

  • result (number)

target⚓︎

Read-only. The scene graph object that this animation controller is to animate.

Returns:


Methods⚓︎

clone⚓︎

Creates a copy of this object.

local result = myObject:clone()

Returns:


isInstanceOfType⚓︎

Determines if the object is of a given type, or of a type derived from the given type.

local result = myObject:isInstanceOfType(type)

Parameters:

Returns:

  • result (boolean)

isOfType⚓︎

Determines if the object is of a given type.

local result = myObject:isOfType(type)

Parameters:

Returns:

  • result (boolean)

saveBinary⚓︎

Serializes the object, and writes it to the given file.

local success = myObject:saveBinary(path)

Parameters:

  • path (string): The path to write the file at, relative to the Morrowind installation folder.

Returns:

  • success (boolean): If true the object was successfully serialized.

setTarget⚓︎

This method assigns a new target to the animation controller.

myObject:setTarget(target)

Parameters:


start⚓︎

Starts the controller at the specified time. Intended for controllers with animTimingType of 1.

myObject:start(time)

Parameters:

  • time (number)

stop⚓︎

Stops the controller. If you only want to pause the controller, use the update property.

myObject:stop()