Reference navigation
On this page
Unthread
Reverse Thread, pulling actual molecular geometry out of view along curved paths.
from proteinmotion import UnthreadConstructor
Unthread(
protein,
camera=None,
*,
mode='geometry',
aspect=None,
radius=0.45,
settle=None,
swirl=1.0,
head=None,
glow=12.0,
glow_color=None,
glow_brightness=1.0,
easing=None,
stagger=0.0,
resolution=None,
seed=0,
rate_func=None,
delay_seconds=None,
stagger_fraction=None,
wire_options=None,
)Parameters
| Parameter | Default | Description |
|---|---|---|
protein | Required | Protein to take out of view. |
camera | None | Scene camera for departure past the frame edges. |
modekeyword only | 'geometry' | "3d" draws lines within the model; "2d" draws lines over the image. |
aspectkeyword only | None | Image width divided by height. |
radiuskeyword only | 0.45 | 3D line cylinder radius in ångströms. |
settlekeyword only | None | Final fraction of the clip for the wire-to-protein crossfade. Applies only to wire mode. |
swirlkeyword only | 1.0 | Strength of the corkscrew around each flight path; 0 gives smooth arcs. |
headkeyword only | None | Radius of the wire's tip, as a multiple of the wire radius. |
glowkeyword only | 12.0 | Halo radius around each leading terminus, as a multiple of radius; 0 turns the glow off. |
glow_colorkeyword only | None | Halo color; None blends each chain's color with warm white. |
glow_brightnesskeyword only | 1.0 | Halo intensity multiplier. |
easingkeyword only | None | Named easing (smooth, linear, ease_in_out_sine, there_and_back) or callable mapping [0, 1] to [0, 1]. Per-item easing preserves stagger timing. |
staggerkeyword only | 0.0 | Delay between chains, as a fraction of the threading time, in chain order. |
resolutionkeyword only | None | Spacing in Å between wire points. |
seedkeyword only | 0 | Integer that varies the flight paths. |
rate_funckeyword only | None | Callable that maps progress in [0, 1] to a finite value in [0, 1]. |
delay_secondskeyword only | None | Delay between successive residue, chain, or glyph starts, in seconds. Choose one delay option. |
stagger_fractionkeyword only | None | Total clip fraction reserved for staggered starts, in [0, 1). |
wire_optionskeyword only | None | Legacy wire-only settings: settle, head, resolution. Requires mode=wire. |
Notes
Takes the same options as Thread; the motion is its exact reverse, so with stagger the last chain leaves first.
Example and output
Run this command from a repository checkout.
proteinmotion render examples/thread_hemoglobin.py ThreadHemoglobin \
--fps 60 -o hemoglobin.mp4Four wires fly in from four sides and thread the α and β subunits of human deoxyhemoglobin from their C termini, one after another. The cartoon and the four hemes then fade in, and the wires pull back out.
Methods and properties
| Name | Description |
|---|---|
| targetsproperty · inherited from Thread | Objects whose state this animation changes. |
| bind()method · inherited from Thread | Capture starting values when the scene schedules the animation. |
| apply()method · inherited from Thread | Evaluate the animation at eased progress alpha. Called by the timeline. |
| during()method · inherited from Animation | Set this animation duration and start delay in seconds. |
Inherited from thread.Thread.
Unthread.targetsObjects whose state this animation changes.
Inherited from thread.Thread.
Unthread.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 thread.Thread.
Unthread.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.
Unthread.during(seconds, *, delay=0)Set this animation duration and start delay in seconds.
| Parameter | Default | Description |
|---|---|---|
seconds | Required | Positive animation duration in seconds. |
delaykeyword only | 0 | Nonnegative animation start delay in seconds. |