Viewport Interactivity #1121
PardhavMaradani
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Brady, creating this discussion from the discord conversation about having interactivity in the viewport to select / highlight stuff.
First, here is a quick example that interactively highlights the residue under the mouse (as the mouse hovers) with a ball and stick style, shows the atom details (of the atom under / closest to the mouse) within that residue and also the distance of this residue center-of-mass to the protein center-of-mass:
mn-viewport-interactivity.mp4
Here is the code that sets up the exact same example shown in the video above. This can be executed from Blender's text editor. (You might have to install the
MDAnalysisTestspackage if not already present):Show Code
A few general thoughts on this:
gpumodule and in our draw code, I didn't see a way to access the geometry as currently rendered in the viewport (after having passed through the geometry nodes) - we'll have access to the 3d view as an image buffer, but that doesn't help<index>,<resid>,<segid>, etc) that get the respective values in the interactive mode. Not sure if this will work for any complex use cases, but could work for simpler onesAll reactions