ProteinMotion
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.

python
from proteinmotion import Reveal

Constructor

python
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

ParameterDefaultDescription
cameraRequiredThe scene camera that owns the cutaway.
regionNoneRegion or Protein to reveal. A second Reveal on the open region reshapes its window smoothly.
windowkeyword onlyNoneWindow radius, as a multiple of the region's bounding radius.
softnesskeyword onlyNoneFraction of the window used for its fading edge, in (0, 1].
bandkeyword onlyNoneDepth in Å over which geometry just in front of the region fades back in.
shapekeyword onlyNone"cone" for a window that faces the camera, or "tunnel" for a depth tunnel fixed to the molecule.
wallkeyword onlyNoneTunnel wall opacity.
ringskeyword onlyNoneTunnel ring spacing in Å, measured from where the tunnel meets open space.
paddingkeyword onlyNoneExtra highlight size in ångströms. None selects a default for the highlight style.
surface_keepkeyword onlyNoneFraction of the inner kept region for the cutaway surface, in [0, 1].
rimkeyword onlyNoneRim-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.

Code Render command
bash
proteinmotion render examples/depth_tunnels.py DepthTunnels \
  --fps 60 -o tunnels.mp4
Output Preview · 64.4 s · 60 fps
How deep is it?

Tunnels 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

NameDescription
bind()methodCapture starting values when the scene schedules the animation.
apply()methodEvaluate the animation at eased progress alpha. Called by the timeline.
during()method · inherited from AnimationSet this animation duration and start delay in seconds.
targetsproperty · inherited from AnimationObjects whose state this animation changes.
python
Reveal.bind()

Capture starting values when the scene schedules the animation.

Returns: None

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

python
Reveal.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
Reveal.during(seconds, *, delay=0)

Set this animation duration and start delay in seconds.

ParameterDefaultDescription
secondsRequiredPositive animation duration in seconds.
delaykeyword only0Nonnegative animation start delay in seconds.

Inherited from animation.Animation.

python
Reveal.targets

Objects whose state this animation changes.