ProteinMotion
Reference navigation
On this page

CLASS · v0.9.1

AnnotationAnimate

Build position, offset, and opacity animations for annotations.

python
from proteinmotion.annotations import AnnotationAnimate

Constructor

python
AnnotationAnimate(target)

Parameters

ParameterDefaultDescription
targetRequiredObject to animate or use as a destination. The supported object type depends on the operation.

Notes

Use annotation.animate. Text and Callout support move_to() and shift(); ResidueLabel supports set_offset(). All support set_opacity().

Methods and properties

NameDescription
move_to()methodSet or animate text position in normalized image coordinates.
shift()methodTranslate the object by an offset.
set_offset()methodSet or animate a residue label’s offset from its projected atom.
set_opacity()methodSet or animate opacity in [0, 1].
bind()methodCapture starting values when the scene schedules the animation.
apply()methodEvaluate the animation at eased progress alpha. Called by the timeline.
targetsproperty · inherited from AnimationObjects whose state this animation changes.
python
AnnotationAnimate.move_to(position)

Set or animate text position in normalized image coordinates.

ParameterDefaultDescription
positionRequiredImage coordinates (x, y), with (0, 0) at the top-left and (1, 1) at the bottom-right.

Returns: The annotation or animation builder.

python
AnnotationAnimate.shift(offset)

Translate the object by an offset.

ParameterDefaultDescription
offsetRequiredOffset (x, y) in design pixels at 1080p for residue labels; normalized image units for text shifts.

Returns: The object or animation builder.

python
AnnotationAnimate.set_offset(offset)

Set or animate a residue label’s offset from its projected atom.

ParameterDefaultDescription
offsetRequiredOffset (x, y) in design pixels at 1080p for residue labels; normalized image units for text shifts.

Returns: The label or animation builder.

python
AnnotationAnimate.set_opacity(value)

Set or animate opacity in [0, 1].

ParameterDefaultDescription
valueRequiredValue to assign; the supported range depends on the property.

Returns: The object or animation builder.

python
AnnotationAnimate.bind()

Capture starting values when the scene schedules the animation.

Returns: None

Called by ProteinScene.play(). An animation instance can be bound once.

python
AnnotationAnimate.apply(alpha)

Evaluate the animation at eased progress alpha. Called by the timeline.

ParameterDefaultDescription
alphaRequiredEased animation progress in [0, 1].

Returns: None

Inherited from animation.Animation.

python
AnnotationAnimate.targets

Objects whose state this animation changes.