Skip to content

Procedural animation#1805

Draft
arose wants to merge 6 commits intomasterfrom
proc-anim
Draft

Procedural animation#1805
arose wants to merge 6 commits intomasterfrom
proc-anim

Conversation

@arose
Copy link
Copy Markdown
Member

@arose arose commented Apr 2, 2026

Description

Adds procedural animation to wiggle (move atoms) and tumble (rotate chains). It runs on the GPU, is very cheap and has absolutely no regard for physics or chemistry - might still be useful to convey dynamics or highlight uncertainty.

viewer: https://molstar.org/dev/anim/
me: https://molstar.org/dev/anim/me/

easiest way to activate is with the new panels

image image

Examples

28LU_camera-rock.1.mp4

Wiggle atoms based on B-factor

PSF.EXT.CMAP_camera-rock.4.mp4

Convey dynamics for a simulation system

CELLPACK_MODEL_camera-rock.1.mp4

Mesoscale model dynamics

Actions

  • Added description of changes to the [Unreleased] section of CHANGELOG.md
  • Updated headers of modified files
  • Added my name to package.json's contributors
  • (Optional but encouraged) Improved documentation in docs

@giagitom
Copy link
Copy Markdown
Collaborator

giagitom commented Apr 2, 2026

Very nice implementation!

I see some separations at group level, particularly on cartoons and sticks (on cartoons only when using Uncertainty mode)

image

Copy link
Copy Markdown
Member

@dsehnal dsehnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a good way to make this available in MolViewSpec? Could be a "custom extension" -- but should this be on "representation" node?

}

class StructureProceduralAnimation extends PurePluginUIComponent<{}, StructureProceduralAnimationState> {
state: StructureProceduralAnimationState = { busy: false };
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should likely come from the PluginContext is busy too, no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it follows the same pattern as in QuickStyles UI

const options = this.plugin.managers.structure.component.state.options;
await this.plugin.managers.structure.component.setOptions({
...options,
animation: {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's be explicit here that this is proceduralAnimation?

@arose
Copy link
Copy Markdown
Member Author

arose commented Apr 2, 2026

I see some separations at group level, particularly on cartoons and sticks (on cartoons only when using Uncertainty mode)

yes, we animate vertex positions without knowledge of atom connectivity. In 'position' mode things generally stay reasonably together because noise is position-based. In 'group' mode the noise is group based which can look better for some representations but will rip different groups apart. For bond cylinder imposter geometry the gaps are due to differently tilts of each bond half. If you disable impostors they will stay connected. When wiggle by uncertainty the wiggle amplitude changes per group (atom) which will inevitable "rip" geometry corresponding to different groups apart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants