Hello Warren, all,
I've been working on a plugin for PyMOLX11Hybrid, in which I have a few lines of code such as:
cmd.alter_state(1, copy, "x,y,z = sym_partner([x,y,z], stored.tmpOp)")
cmd.alter_state(1, object, "x,y,z = cell_shift_helper([x,y,z],stored.shift)")
Both those functions (sym_partner and cell_shift_helper) are extended through cmd.extend() function, along with several others which work perfectly well. The issue arises only when I attempt to use these functions through a menu added to PyMOL GUI, which does not involve issuing the run /(filepath)/(script).py command in PyMOL, but rather initializes necessary commands on startup. I've confirmed that the cmd.extend() calls are made properly, but I can only fix the problem by issuing the run command independent of my initialization scripts.
Because this script is planned to be incorporated into a build of PyMOL which will be run from a variety of file paths, I'd like to know how I can solve this problem without simply jury rigging a run command. Is there a way to properly make commands available within an alter_state command without using the run command?
Dept. of Biochemistry