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
This PR borrows from Atomic Blender, particularly the function
draw_atoms_one_type
in thepdb_import
file: https://projects.blender.org/extensions/io_mesh_atomic/src/branch/main/source/pdb_import.py#L657It'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