good idea, Rick. I can do that. Also, in the mean time, you can try in 
your callback function:

var animationInfo = jmolGetPropertyAsArray("animationInfo")

this provides an array with some valuable elements:

animationInfo.lastFrameDelay=0
animationInfo.firstModelIndex=0
animationInfo.displayModelIndex=0
animationInfo.animationReplayMode=0
animationInfo.animationPaused=false
animationInfo.displayModelName="xxx"
animationInfo.lastModelIndex=12
animationInfo.animationOn=false
animationInfo.animationDirection=1
animationInfo.currentDirection=1
animationInfo.firstFrameDelay=0
animationInfo.animationFps=10
animationInfo.displayModelNumber=1

Note there the two:

animationInfo.animationDirection=1
animationInfo.currentDirection=1

Alas, it is complicated, and I'm not convinced it is bug-free. I think I 
just fixed a bug there, but it's hard to say.

Standard animation involves animationDirection = 1 and currentDirection 
= 1.

If one sets "anim direction -1", then the animation plays backward, but 
currentDirection = 1 still.

Each time you use "anim playrev" the currentDirection switches from 1 to 
-1, but animationDirection does not change.

So to know which way an animation is actually running, you have to 
consider both these numbers. I think I will put their product into this 
variable.

Bob


rspinney wrote:

>>animFrameCallback
>>-----------------
>>
>>The animFrameCallback JavaScript function now returns seven values, several
>>    
>>
>of which >are specifically useful in a multifile context:
>  
>
>>function
>>    
>>
>animFrameCallback(app,frame,fileno,modelno,firstno,lastno,isRunning){
>  
>
>> //#1 app: applet identifier
>> //#2 frame: absolute frame number, starting with 0
>> //#3 fileno: file number associated with this frame, starting with 1
>> //#4 modelno: model number associated with this frame, starting with 1
>> //#5 firstno: the file and model of the first frame in the animation
>>    
>>
>range as 1000000 >* fileno + modelno
>  
>
>> //#6 lastno: the file and model of the last frame in the animation range
>>    
>>
>as 1000000 * >fileno + modelno
>  
>
>> //#7 isRunning: 0 -- animation is off; 1 -- animation is on
>>}
>>    
>>
>
>Bob, 
>
>thanks for the hints on the animation scripting. I now have it working with
>one small exception. I need to get the animation direction info. With the
>addition of "isRunning" to the animframecallback function, if it would be
>easy to change isRunning to:
>
>-1 for animation direction -1 
>0 animation is off
>+1 for animation direction +1
>
>This single variable can then indicate both that the animation is on and the
>direction.
>
>
>Thanks, Rick
>
>
>-------------------------------------------------------------------------
>This SF.net email is sponsored by DB2 Express
>Download DB2 Express C - the FREE version of DB2 express and take
>control of your XML. No limits. Just data. Click to get it now.
>http://sourceforge.net/powerbar/db2/
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to