This script will create a new Gcode for your printer based on you own Gcode, It will look for layer changes and will implent new Code commands between each layer. This would foe example move your print head away from the print, and push the photo button with the bed, these photos can be used to create awesome 3d printing timelapse.
See 'CameraScript.py' for variables such as the X and Y park position.
You need Python to tun this, please see https://www.python.org/downloads/
This script does work for me and my Ender 3, And it should be good to run as long as you set your park positions right (not all printers can move to the default X and Y position) Also I do my best to keep it working and make it up to date, but: These codes are provided "as is", without warranty or any kind, express or implied, including but not limited to the safety of the code. In no event shall I/we be liable for any claim, damages, or other liability, nomatter the connection or contracts between us. Feel free to use the code and comment and work on it, and don’t forget to credits where credit is due.