From: Ondrej Marsalek (ondrej.marsalek_at_gmail.com)
Date: Sun Nov 30 2008 - 15:58:56 CST

On Sun, Nov 30, 2008 at 12:46, Axel Kohlmeyer
<akohlmey_at_cmm.chem.upenn.edu> wrote:
> On 11/29/08, Ondrej Marsalek <ondrej.marsalek_at_gmail.com> wrote:
>> hello all,
>>
>> i have the following problem with vmd. i would like to load
>> (volumetric) data on the fly, as they won't fit into memory all at
>> once. it all works fine using some (python) scripting, except for one
>> thing. every time data get loaded, my view position is reset. i have
>> not managed to prevent it and i have not managed to restore the
>> original view.
>
> i cannot help with python scripting, but if you look at the attached
> function that i use to update a dataset from a running simulation,
> you can see how to temporarily save and restore the view and zoom
> settings around loading data.

in the meantime, i have found one more thing. this was in a callback
function and i thought it made sense so i had update_off and update_on
at the very beginning and end of the callback function. removing these
solved the problem, restoring the view now works fine. sort of
unexpected, but at least it works now. i use the python equivalent of
what you have in your code.

>>
>> if i save all the view parameters, i can restore the view from these
>> if i do it "by hand", some time after the data are loaded. if,
>> however, i do it in a script just after a call to
>> VMD.molecule.add_volumetric or something similar, the view still gets
>> reset. my suspicion is that the call to add_volumetric returns
>> immediately, loading data in the background a reseting the view at the
>

> again, i don't know much about the python interface, i always found it
> a bit awkward to use, somewhat incomplete and painful to get working
> (i guess there are some python "believers" around that can correct
> me),

i agree that the python interface is not great. still, i know python
better than tcl and i want to interact with my own python code (the
source of the volumetric data). i am certainly not a "believer", i just
find it genuinely useful.

> but there should be some kind of equivalent to the waitfor all flag
> that you can use with the mol addfile command of the tcl interpreter.
>

there is one and probably it works as it should, see above.

> (or you can do the writing in tcl right from the beginning...).

see above. plus, i personally find the whole of tcl awkward, but that is
not a complaint, just an opinion. in this particular case, if it was
more useful than python, i'd go with it, but it is not.

> cheers,
> axel.
>

regards,
ondrej