Yes, that would work, Angel.

You can also use

set animFrameCallback "jmolscript:) if(_lastframe == _modelnumber);echo 
END;set animFrameCallback \"jmolScript:\";endif"

OK, what is this!?? [That's not a happy face after "jmolscript", it's a 
colon and a close parenthesis. That parenthesis at the start of a 
command tells Jmol to not record the command in the command history. (I 
think that is undocumented.) ]

It says, "when the frame changes, run the following Jmol script (and 
don't put it in the history)":

if(_lastframe == _modelnumber);
    echo END;
    set animFrameCallback "jmolScript:";
endif;

That is, at the last frame, echo "END" and then turn off the animation 
frame callback. That way it doesn't continue to echo END each time the 
frame changes -- (And there is an odd feature that otherwise the 
end-of-frame callback is triggered twice; I don't know why.)


Angel Herráez wrote:

>Well, I've found a workaround.
>
>Instead of using "anim on" I do a while loop with Jmol internal read-only 
>variables and "anim next":
>
>set echo top
>model rewind
>echo Animation going
>while ( _modelNumber != _lastFrame )
>  model next
>  delay 0.25
>end while
>echo Ended
>
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by: Microsoft
>Defy all challenges. Microsoft(R) Visual Studio 2008.
>http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get. 

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to