Reference navigation
On this page
Reveal
Open a view-dependent cutaway onto a region: geometry in front of it fades inside a window that follows the camera.
from proteinmotion import RevealConstructor
Reveal(
camera,
region=None,
*,
window=None,
softness=None,
band=None,
shape=None,
wall=None,
rings=None,
padding=None,
surface_keep=None,
rim=None,
**kwargs,
)Parameters
| Parameter | Default | Description |
|---|---|---|
camera | Required | The scene camera that owns the cutaway. |
region | None | Region or Protein to reveal. A second Reveal on the open region reshapes its window smoothly. |
windowkeyword only | None | Window radius, as a multiple of the region's bounding radius. |
softnesskeyword only | None | Fraction of the window used for its fading edge, in (0, 1]. |
bandkeyword only | None | Depth in Å over which geometry just in front of the region fades back in. |
shapekeyword only | None | "cone" for a window that faces the camera, or "tunnel" for a depth tunnel fixed to the molecule. |
wallkeyword only | None | Tunnel wall opacity. |
ringskeyword only | None | Tunnel ring spacing in Å, measured from where the tunnel meets open space. |
paddingkeyword only | None | Extra highlight size in ångströms. None selects a default for the highlight style. |
surface_keepkeyword only | None | Fraction of the inner kept region for the cutaway surface, in [0, 1]. |
rimkeyword only | None | Rim-light intensity, or a cutaway rim RGB/hex color for Reveal. |
**kwargs | — | Additional keyword options described below or in the linked constructor. |
Notes
Works in the native renderer and in EEVEE. Atoms keep the region's bounding sphere, while cartoons and molecular surfaces are carved closer to its center. With shape='tunnel', a cylinder is drilled along the current view, stays fixed to the molecule, and shows a ring every `rings` Å from where its centerline reaches open space. No atoms move.
Example and output
Run this command from a repository checkout.
proteinmotion render examples/depth_tunnels.py DepthTunnels \
--fps 60 -o tunnels.mp4Tunnels into GroEL–GroES, with a ring every 5 Å, compare the ADP pocket 21 Å beneath the outer surface with residues on the ring's inner wall 44 Å down. A ghosted side view, a fly-down, and a carved surface follow.
Methods and properties
| Name | Description |
|---|---|
| bind()method | Capture starting values when the scene schedules the animation. |
| apply()method | 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. |
| targetsproperty · inherited from Animation | Objects whose state this animation changes. |
Reveal.bind()Capture starting values when the scene schedules the animation.
Returns: None
Called by ProteinScene.play(). An animation instance can be bound once.
Reveal.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.
Reveal.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. |
Inherited from animation.Animation.
Reveal.targetsObjects whose state this animation changes.