schrodinger / pymol-open-source

Open-source foundation of the user-sponsored PyMOL molecular visualization system.
https://pymol.org/
Other
1.15k stars 275 forks source link

[feature request] Load a molecule with the same name into a new object #325

Closed JerryJohnsonLee closed 7 months ago

JerryJohnsonLee commented 9 months ago

Currently, when I drag and drop a file with the same name with existing objects in pymol, it is automatically added as a new state of the existing molecule instead of creating a new object (even if the number of atoms are different!). I would like to control the behavior for this situation so that the user can decide whether a new object is created, or it is loaded as a new state. In my workflow I have a lot of files with the same file name (under different folders), so it is really cumbersome to have to rename an old object before loading the new one, or having to split state after the new molecule is added

JarrettSJohnson commented 9 months ago

Thanks for the request. I do believe that there should be more consistent behavior for this. Depending on the type of object you're loading/creating, it could be appended as a state, replacing the old object, or just rejected. Perhaps a setting or additional argument would provide some more control. Ideally, the default behavior should be unified across all types too.

speleo3 commented 7 months ago

The setting auto_rename_duplicate_objects might help for some use cases.

cmd.set("auto_rename_duplicate_objects")
JerryJohnsonLee commented 7 months ago

The setting auto_rename_duplicate_objects might help for some use cases.

cmd.set("auto_rename_duplicate_objects")

Thank you very much! This is exactly what I want.

JarrettSJohnson commented 7 months ago

Thanks Thomas. TIL!