Skip to content

Implement interaction visualization #692

@MartinBaGar

Description

@MartinBaGar

I created a blender extension to visualize interactions occuring in a molecular dynamics simulations. After a quick chat with @BradyAJohnston and one Blender reviewer, we though of implementing this extension directly into Molecular Nodes.
Let's discuss it here !

The code is curently hosted on my repo Viber.

It is quite simple and it doesn't use python librairies external those of the version used by blender.
There are actually two steps that are necessary visualize the interactions, the first is external to Blender and the extension and the second is the one handled by the extension.

  • The first one consists in identifying the interactions occuring in the simulation and storing this information into a JSON file. I give mini-tutorial in a jupyter notebook stored on my repo that should help you generating this JSON file.
  • The second one simply reads the JSON file, identifies interactions (e.g., between Atom 1 and Atom 2), and uses Blender's API to create an "interaction" object that has the same coordinates as the vertices 1 and 2 (for Atoms 1 and 2) in the Blender model generated by Molecular Nodes. For each frame, a Blender frame handler will update "interaction" object coordinates by following the corresponding vertices in the MN object.

I think that the first step should stay external as everybody can have its own method for detecting interactions. Having a universal JSON format allows each method to be visually represented in Blender.
The second step might be the most important one for the implementation.

On the cosmetics part, it currently different materials for the most frequent interactions (hydrogen bonding, salt-bridge, pi-stacking, pi-cation) but it can be enhanced to support many more interactions.

Is there something you want to consider in priority for this implementation ? If something is not clear, please tell me !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions