Skip to content

Instantly share code, notes, and snippets.

@andersx
Created October 15, 2020 14:35
Show Gist options
  • Save andersx/d30a80ecea6c899279f1a8de978177be to your computer and use it in GitHub Desktop.
Save andersx/d30a80ecea6c899279f1a8de978177be to your computer and use it in GitHub Desktop.
XYZ to GIF
#!/usr/bin/env bash
# mcgif.pml
# # load opt.xyz
# show sticks, all
# bg_color white
# color grey05, elem c
# preset.ball_and_stick(selection='all', mode=1)
# set ray_trace_mode, 1
# viewport 1024, 768
#
# set ray_trace_gain, 0.1;
# set ray_shadow_decay_factor, 0.1;
# set ray_shadow_decay_range, 2;
#
# set antialias, 2;
# set reflect,0.5;
#
# set light_count,20;
# set spec_count,1;
# set shininess, 100;
# set specular, 1;
# set direct,0;
# set reflect,1.5;
#
# # set ray_opaque_background, 0.5
#
# set ray_trace_frames=1
# set cache_frames=0
#
# mclear
# mpng mov
SCRIPT=/home/andersx/bin/mcgif.pml
WORK_DIR=`pwd`
INPUT=$1
OUTPUT=${1%.xyz}.gif
cp $INPUT /tmp/
cd /tmp/
rm -f /tmp/mov*.png
cp $PWD/$INPUT .
pymol -c $INPUT $SCRIPT
cd $WORK_DIR
convert -delay 25 -loop 0 /tmp/mov*.png $WORK_DIR/$OUTPUT
rm -f /tmp/mov*.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment