Got the animation script working (only outside the notebook environment).