AndrewRadev / protein-runway

Integrated Bioinformatics Project
1 stars 0 forks source link

Render atoms of uploaded file, animate trajectory #36

Closed AndrewRadev closed 1 week ago

AndrewRadev commented 1 week ago

This PR borrows from Atomic Blender, particularly the function draw_atoms_one_type in the pdb_import file: https://projects.blender.org/extensions/io_mesh_atomic/src/branch/main/source/pdb_import.py#L657

It's not exactly the same code, but their "instancing" method is pretty sensible. The individual atom points are considered part of the same "mesh" rather than separate objects. Their color and material is rendered based on a representative point.

Animating this means changing the "co" property of the individual vertices. This is the slowest part. We should look for ways to make this more efficient, but we probably should offload this in some way to something that processes each frame and then gives back a progress indicator. Here's a discussion with an example implementation: https://blenderartists.org/t/using-new-layout-progress-function-in-4-0/1493965/7