splib.animation

Animation framework focusing in ease of use.

Functions:

animate(onUpdate, params, duration[, mode, …]) Construct and starts an animation
AnimationManager(node) A Controller to manage all animations in the scene
AnimationManagerController MagicMock is a subclass of Mock with default implementations of most of the magic methods.

splib.animation.animate

splib.animation.animate(onUpdate, params, duration, mode='once', onDone=None)[source]

Construct and starts an animation

Build a new animation from a callback function that computes the animation value, a set of parameters, the animation duration and the type of animation repetition pattern.

Animation can be added from any code location (createScene, PythonScriptController)

Parameters:
  • duration (float) – duration of the animation in seconds.
  • mode (str) – once, loop, pingpong
Example:
def myAnimate(target, factor):
    print("I should do something on: "+target.name)


def createScene(rootNode)
    AnimationManager(rootNode)
    animate(myAnimate, {"target" : rootNode }, 10)

splib.animation.AnimationManager

splib.animation.AnimationManager(node)[source]

A Controller to manage all animations in the scene

Before using the animation framework an AnimationManager must be added to the scene. It has in charge, at each time step to update all the running animations.

Returns:
AnimationManagerController
Example:
def createScene(rootNode)
    AnimationManager(rootNode)

splib.animation.AnimationManagerController

splib.animation.AnimationManagerController

Modules:

splib.animation.easing Easing function to use in animation