colvars icon indicating copy to clipboard operation
colvars copied to clipboard

Molecule view reset when loading coordinates in VMD

Open jhenin opened this issue 4 years ago • 3 comments

When creating a colvar that requires reading a PDB file, some background operation (possibly the creation of a temporary molecule) cause the camera viewpoint to be reset. It would be nice to avoid this side effect if possible.

jhenin avatar Apr 02 '20 08:04 jhenin

This is the line where the VMD PDB file reader is invoked (original commit 23f8480151ecc4efb03c9172e0804456d509d6ce):

  int tmpmolid = vmd->molecule_load(-1, pdb_filename, "pdb", tmpspec);

A VMD DrawMolecule instance is needed to get the various fields, but it should be possible to call directly the molfile function, since the format is assumed to be "pdb" anyway.

giacomofiorin avatar Apr 02 '20 14:04 giacomofiorin

From a quick look at the implementation of molecule_load() there are a few plugin functions to be called. If you choose to just back up the VMD view with Tcl in the Dashboard (useful for other purposes, too), please keep the issue open. I wouldn't mind removing the need to create a temporary molecule altogether and use the molfile reader directly.

giacomofiorin avatar Apr 02 '20 14:04 giacomofiorin

If you choose to just back up the VMD view with Tcl in the Dashboard

Done, keeping the issue open.

jhenin avatar Apr 03 '20 07:04 jhenin

Done. Completed!

giacomofiorin avatar Sep 01 '22 20:09 giacomofiorin