ofAnimationTime

open fun ofAnimationTime(model: AnimatableModel, animationName: String, times: Array<Float>): ObjectAnimator

Constructs and returns an ObjectAnimator clipping a ModelAnimation to a given set of time values.

Don't forget to call start

Return

The constructed ObjectAnimator

Parameters

model

The targeted model to animate

animationName

The string name of the animation. This name should correspond to the one defined and exported in the model. Typically the action name defined in the 3D creation software. getName

times

The elapsed times (between 0 and getDuration that the ModelAnimation will animate between.

See also


open fun ofAnimationTime(model: AnimatableModel, animationIndex: Int, times: Array<Float>): ObjectAnimator

Constructs and returns an ObjectAnimator clipping a ModelAnimation to a given set of time values.

Don't forget to call start

Return

The constructed ObjectAnimator

Parameters

model

The targeted model to animate

animationIndex

Zero-based index for the animation of interest.

times

The elapsed times (between 0 and getDuration that the ModelAnimation will animate between.

See also


Constructs and returns an ObjectAnimator clipping a ModelAnimation to a given set of time values.

Time values can help you targeting a specific position on an animation coming from a 3D creation software with a default times based timeline. It's the 3D designer responsibility to tell you what specific timeline position corresponds to a specific model appearance.

  • A single value implies that that value is the one being animated to starting from the actual value on the provided ModelAnimation.
  • Two values imply a starting and ending values.
  • More than two values imply a starting value, values to animate through along the way, and an ending value (these values will be distributed evenly across the duration of the animation).

The properties (time, frame,... position) are applied to the AnimatableModelThis method applies by default this to the returned ObjectAnimator :

  • The duration value to the getDuration in order to match the original animation speed.
  • The interpolator to LinearInterpolator in order to match the natural animation interpolation.

Don't forget to call start

Return

The constructed ObjectAnimator

Parameters

model

The targeted model to animate

animation

The animation of interest

times

The elapsed times (between 0 and getDuration that the ModelAnimation will animate between.