Animation¶
-
class
pcsg.animation.Animation(name: str, initialPosition: list, pathes: Optional[list] = None, rounding: float = 1.0, damping: float = 1.0)¶ An animation interpolates a control parameter between key frames. The interpolated value can be a vector or a float number.
-
addPath(path)¶ Adds a path to this animation.
-
damping¶ Acceleration damping factor (range 0 to 1). Higher damping factors look smoother. Default is 1.
-
getAnimationTime()¶ Get time of animation.
-
getEndPosition()¶ Get end position of animation.
-
getInitialPosition()¶ Get initial position of animation.
-
getPosition(time)¶ Get animation position for a time stamp.
-
initialPosition¶ The initial position of the animation as number or vector.
-
name¶ Name of the animation. The name is used to create a key in the Attributes object.
-
path(relativeTime=None, absolutePosition=None, pathType=<PathType.CURVE: 2>, absoluteTime=None, relativePosition=None, rounding=None, damping=None)¶ Convenience method to add pathes.
-
rounding¶ Rounding factor (range 0 to 1). Higher rounding factors look smoother. Default is 1.
-
Path¶
Each animation consists of Pathes. A Path describes how to interpolate the positions between two key frames.
-
class
pcsg.animation.Path(relativeTime=None, absolutePosition=None, pathType=<PathType.CURVE: 2>, absoluteTime=None, relativePosition=None, rounding=None, damping=None)¶ Path element of an Animation.
-
absolutePosition¶ Absolute end position of this Path.
-
absoluteTime¶ Absolute end time of this Path.
-
damping¶ Acceleration damping factor (range 0 to 1). Higher damping factors look smoother. When None (default), the value will be taken from the parent Animation.
-
pathType¶ Interpolation type of Path.
-
relativePosition¶ Relative end position of this Path.
-
relativeTime¶ Duration of this Path.
-
rounding¶ Rounding factor (range 0 to 1). Higher rounding factors look smoother.
-
-
class
pcsg.animation.PathType(value)¶ Interpolation type of Path.
-
CURVE= 2¶ Create smooth curve as path.
-
LINEAR= 3¶ Create straight line as path.
-
MAY_STOP= 1¶ Stop the animation if path length is zero. Curve interpolation else.
-
STEP= 4¶ Create step response.
-
STOP= 0¶ Stop animation. Length of the path must be zero.
-