ofAnimation

open fun ofAnimation(model: AnimatableModel, animationNames: Array<String>): ObjectAnimator

Constructs and returns an ObjectAnimator for targeted ModelAnimation with a given name inside an AnimatableModel. The setAutoCancel(true) won't work for new call with different animations.

Don't forget to call start

Return

The constructed ObjectAnimator

Parameters

model

The targeted model to animate

animationNames

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

See also


open fun ofAnimation(model: AnimatableModel, animationIndexes: Array<Int>): ObjectAnimator

Constructs and returns an ObjectAnimator for targeted ModelAnimation with a given index inside an AnimatableModel. The setAutoCancel(true) won't work for new call with different animations.

Don't forget to call start

Return

The constructed ObjectAnimator

Parameters

model

The targeted animatable to animate

animationIndexes

Zero-based indexes for the animations of interest.

See also


Constructs and returns an ObjectAnimator for a targeted ModelAnimation inside an AnimatableModel. The setAutoCancel(true) won't work for new call with different animations. This method applies by default this to the returned ObjectAnimator :

  • The duration value to the max 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 animatable to animate

animations

The animations of interest