Reference navigation
On this page
CLASS · v0.9.1
Unwrite
Erase glyph fills and then their outlines.
from proteinmotion import UnwriteConstructor
Unwrite(target, *, lag_ratio=None, stroke_width=1.5, reverse=False, rate_func=linear)Parameters
| Parameter | Default | Description |
|---|---|---|
target | Required | Annotation to draw: Text, Callout, ResidueLabel, ResidueLabels, Distance, or InteractionHighlight. |
lag_ratiokeyword only | None | Delay between glyph starts relative to glyph duration; None chooses a value from glyph count. |
stroke_widthkeyword only | 1.5 | Glyph outline width in design pixels at 1080p. |
reversekeyword only | False | Reverse residue or glyph order. |
rate_funckeyword only | linear | Callable that maps progress in [0, 1] to a finite value in [0, 1]. |
Notes
Uses the Write constructor. Glyphs disappear from last to first by default; reverse=True changes that order.
Example and output
This excerpt runs inside a scene’s construct() method. The full example file includes imports, structure loading, and camera setup. Run it from a repository checkout.
Code Scene excerpt
title = Text(
"Protein motion",
font_size=130,
font="semibold",
position=(0.1, 0.38),
)
self.play(
Write(title, lag_ratio=0.12, stroke_width=1.8),
run_time=2.5,
)
self.wait(1)
self.play(Unwrite(title), run_time=1.5)Output Preview · 5.0 s · 60 fps
Letter outlines are drawn, filled, and erased.
Methods and properties
| Name | Description |
|---|---|
| apply()method | Evaluate the animation at eased progress alpha. Called by the timeline. |
| bind()method · inherited from Animation | Capture starting values when the scene schedules the animation. |
| targetsproperty · inherited from Animation | Objects whose state this animation changes. |
Unwrite.apply(alpha)Evaluate the animation at eased progress alpha. Called by the timeline.
| Parameter | Default | Description |
|---|---|---|
alpha | Required | Eased animation progress in [0, 1]. |
Returns: None
Inherited from animation.Animation.
Unwrite.bind()Capture starting values when the scene schedules the animation.
Returns: None
Called by ProteinScene.play(). An animation instance can be bound once.
Inherited from animation.Animation.
Unwrite.targetsObjects whose state this animation changes.