mor.reduction.container.objToAnimate.ObjToAnimate

class ObjToAnimate(location, animFct='defaultShaking', item=None, duration=-1, **params)[source]

Bases: object

Class allowing us to store in 1 object all the information about a specific animation

Args

argument

type

definition

location

Str

Path to obj/node we want to animate

animFct

Str

Name of our function we want to use to animate. During execution of the Sofa Scene, it will import the module mor.animation.animFct where your function has to be located in order to be used.

item

Sofa.Node Sofa.Obj

pointer to Sofa node/obj in which we are working on (will be set during execution).

duration

seconde

(in float)

Total time in second of the animation (put by default to -1 & will be calculated & set later during the execution)

**params

undefined

You can put in addition whatever parameters you will need for your specific animation function, they will be passed to the animFct you have chosen during execution See mor.animation for the specific parameters you need to give to each animation function

Example

To use the animation defaultShaking this is how you declare your ObjToAnimate:

ObjToAnimate( "myNodeToReduce/myComponentToAnimate",
              "defaultShaking",
              incr= 5, incrPeriod= 10, rangeOfAction= 40,
              dataToWorkOn= NameOfDataFieldsToWorkOn)

or for default behavior

ObjToAnimate( "myNodeToReduce/myComponentToAnimate",
              incr=5,incrPeriod=10,rangeOfAction=40)

Methods