-
Notifications
You must be signed in to change notification settings - Fork 4
Setup analysis script on Windows
This guide expects that you are using Slic3r, but it should also work with other slicers.
Download latest Python 3 version from here. During the installation make sure to select "Add Python to Path".

Now open a command prompt (Win + R), type in powershell and press enter.
First install the required dependencies of click and yaml using pip.
> pip install click pyyaml
Now create the directory and download the scripts:
> mkdir $env:APPDATA\Slic3r\scripts\gcode_metadata
> cd $env:APPDATA\Slic3r\scripts\gcode_metadata
> Invoke-WebRequest -Uri https://raw.githubusercontent.com/malnvenshorn/OctoPrint-MetadataPreprocessor/master/scripts/analysis.py -OutFile analysis.py
> Invoke-Webrequest -Uri https://raw.githubusercontent.com/malnvenshorn/OctoPrint-MetadataPreprocessor/master/scripts/generate_metadata_example.bat -OutFile generate_metadata_example.bat
Rename the generate_metadata_example.bat script to whatever you like and modify it to your needs, e.g. modifying the script path or command arguments.
When running the script for the first time it will automatically download the gcodeInterpreter from the OctoPrint source which is required to analyse the gcode. You can also manually download the file and and place it in the same directory as the other scripts, e.g. %APPDATA%\Slic3r\scripts\gcode_metadata. The update behavior can be configured using the update.yaml file.
You can easily integrate the analysis script in your workflow with Slic3r. Simply add the absolute path of the script under the post-processing scripts option.
