#|

Capture Animation

Note: This is an example file showing concepts of the Integration Kit. The code itself is not supported and will never be supported.
|#


(in-package :EXAMPLES)
(use-package :OLI)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defvar *sequence-num*)
(setq *sequence-num* 0)

(sd-defdialog 'capture_animation_nt
  :dialog-title "Capture Anim"
  :variables
  '(
    (REL
     :title "Relation"
     :selection *sd-relation-seltype*
     :initial-value nil
     )

    (FILE
     :title "Filename"
     :value-type :filename
     )
    )

  :ok-action
  '(progn
     (let* ( (img-file (first FILE))
             (path (directory-namestring img-file))
             (filename (pathname-name img-file))
             (extension (pathname-type img-file))
	    )
       (setq *sequence-num* 0)
       (oli:sd-animate-relation REL
			 :function 'dump_window
			 :arguments (list path filename extension)
			 :model-update nil)
       )
     )
)

(defun dump_window (param-list)
  (let ( (path (first param-list))
         (filename (second param-list))
	 (extension (third param-list)) )
  (setq *sequence-num* (+ *sequence-num* 1))
  (frame2:dump-vport "vport1"
                     (format nil "~A~A~3,'0D.~A" path filename *sequence-num* extension)
                     "BMP")
   )
)

;;