(in-package :custom) (use-package :oli) (sd-defdialog 'save-vp-camera :dialog-title "Camera save" :toolbox-button t :variables '( (out-file :title "Save camera file" :value-type :filename :direction :output :if-exists :confirm-overwrite) (capture-btn :title "Capture" :push-action (if out-file (write-vp-cam-file (first out-file)) (sd-display-message "Save camera file needs to be specified first.")) :toggle-type :grouped-toggle))) (sd-defdialog 'load-vp-camera :dialog-title "Camera load" :toolbox-button t :variables '( (in-file :title "Load camera file" :value-type :filename :direction :input) (restore-btn :title "Restore" :push-action (if in-file (read-vp-cam-file (first in-file)) (sd-display-message "Load camera file needs to be specified first.")) :toggle-type :grouped-toggle))) (defun read-vp-cam-file (in-file) (with-open-file (in in-file) (with-standard-io-syntax (sd-set-vp-camera (sd-inq-current-vp) (read in) :smooth t)))) (defun write-vp-cam-file (out-file) (with-open-file (out out-file :direction :output :if-exists :supersede) (with-standard-io-syntax (print (sd-inq-vp-camera (sd-inq-current-vp)) out))))