G-code Snippets, Config and Scripts for Using PrusaSlicer (formerly Slic3r) with the Flashforge Creator Pro
This is a set of configuration bundles and post-processing scripts that allow to use the FlashForge Creator Pro 3D printer and compatible clones with PrusaSlicer. On my website I explain why you should use these files, and how to use PrusaSlicer after installing them. This repository contains the actual software and installation instructions. If you didn't come from that page already, read the webpage itself for the full story, it will link back here at the appropriate moment.
These configs and G-code are made specifically for PrusaSlicer. They might work in the original Slic3r from which PrusaSlicer was forked, but I give no guarantees, and I give no support if you use this with anything else than PrusaSlicer.
Since PrusaSlicer version 2.2, I'm now making releases for these configs with the same (major) version as the PrusaSlicer version they were made for. If for some reason you are using an older version of PrusaSlicer, you should take the .ini file from the release of my configs with the same older version, to avoid backwards compatibility issues.
This repository contains six things:
- ConfigBundles: the main PrusaSlicer config bundle. This is the bare minimum to get things working, but you should preferably also install the next thing:
make_fcp_x3g.pl: a post-processing script that can automate the essential GCode-to-X3G conversion for you, as well as work around an annoying bug in PrusaSlicer, and optionally also invoke certain extra post-processing scripts. You can make do without this script, but it can make your workflow a lot easier.
make_fcp_x3g.txt: a template for the configuration file needed by the post-processing script. Simplest is to ensure that the filled-in template is in the same directory as where you deploy the script.
- Optional-postprocessing-scripts: what the name says. See the README inside that directory for more info.
- GCode: the same G-code snippets that are already embedded into the config bundles, strictly spoken you can ignore this. It is possible that I will make small updates to these snippets without updating the whole config bundles, because that's kind of a hassle. If you see more recent commits in this GCode folder than inside the ConfigBundles folder and you want the latest and greatest, follow the instructions on my site to update them.
- Bed_model: an optional 3D model and texture to have a fancier display in PrusaSlicer. (Some extra work is needed to use these, see the instructions below.)
A warning in advance
If it isn't obvious from the length of this README: setting up PrusaSlicer for the older FFCP is complicated, because of certain design decisions by the Prusa team that make it impossible to provide a ready-to-use config for this printer. If you are still doubting whether to obtain an old FFCP, and you are not looking forward to following the whole ritual described below, then you may want to consider getting a printer for which PS has built-in support instead.
Be careful with the temperatures in the filament presets! If you have not upgraded anything about your printer, you will need to reduce certain temperatures because I tweaked them on a Micro Swiss all-metal hot-end with glass bed + hairspray and hardened steel nozzle, and this setup requires higher temperatures than the stock hot-ends. The temperatures for PLA and ABS are safe, but the temperatures for PETG, flexible filaments, and especially polycarbonate (PC), are well above the 240°C limit for the stock hot-ends with their teflon liners. When in doubt, read the ‘Notes’ for a certain filament profile in PrusaSlicer.
You should never exceed 240°C for longer than a few minutes if you have not upgraded your hot-ends to all-metal. For PETG you should be able to get decent results at 240°C but I do recommend an all-metal hot-end with a pointy steel nozzle and higher temperatures to obtain good results with PETG. (For the best results, you also need variable fan speed to apply mild cooling.) I have included one example PETG filament profile (the one whose name does not end in -fan) that is safe to use on an unmodified FFCP, but don't expect nice-looking results with it on a stock extruder.
FlatPak misery (if you are using Linux)
Prusa's decision to distribute PrusaSlicer in Linux through FlatPak has basically broken the entire workflow of automatically invoking make_fcp_x3g.pl as a post-processing script. You can still use the PrusaSlicer profiles and post-processing script(s) in Linux, but it will require more steps per 3D print.
The problem is that PrusaSlicer now only has direct access to the limited environment inside its FlatPak container, which lacks Perl and also GPX. For the seamless workflow that used to Just Work™, the FlatPak would now need to run the script using a Perl runtime from outside the FlatPak container, but at the same time this runtime would need to read and write to the temporary g-code file inside the container, and then we also have the extra x3g file which will be lost. There is no sane solution to make this work. All my attempts have turned into dead-ends.
Your options are, in increasing order of geek skill level:
- Forget about the automated workflow, do not configure the post-processing script in PrusaSlicer (consider
PATH to be empty in the rest of this guide), and instead run it manually.
- Same as 1, but instead of manually running the script, use something like
inotifywait, or Python's watchdog, to set up a simple script that reacts when you save a .gcode file in a certain directory, and then invokes the make_fcp_x3g.pl script on it. This will work as smoothly as before, but it will require some geekery.
- Compile PrusaSlicer yourself so it can be run outside of FlatPak. Most people will not even want to try this.
Installation and Setup Instructions
If you have a question, please go through both the companion webpage and this README (again). I will most likely not answer any mails that ask something already clearly explained on any of those two pages. If you think parts of this README can be improved, the best thing you can do is provide the improved text, for instance by creating a new GitHub issue or maybe even a pull request, or just by sending the remarks through the contact page of my website.
If you are truly stuck and need to contact me, make sure to mention what operating system you are using, what version of PrusaSlicer, and any other possibly relevant information that could help with troubleshooting.
Step 1: install the make_fcp_x3g.pl script
This script can do many things, but its core functions are to apply an important workaround for a certain bug in PrusaSlicer, and then invoke the GPX program to convert the G-code produced by PrusaSlicer into x3g files that the printer understands. This script will be directly or indirectly configured as a post-processing script in PrusaSlicer to be run automatically after slicing (unless you're doomed to use FlatPak). It will make your workflow easier.
You can choose not to use this and do the GPX conversion and bug workarounds all manually and tediously. In that case, skip to ‘Step 2’ below, but I recommend you do not.
If you are using OctoPrint, you don't need GPX because it does the x3g conversion for you. Otherwise, you do need GPX: first obtain the GPX binary and install it somewhere. Use the most recent GPX build you can find. Do not use 2.0-alpha, it is broken. In MacOS, gpx can be installed through homebrew.
Important: if you are going to use the WSL Linux environment in Windows, do not install the Windows EXE of GPX. Instead, install the Linux GPX executable inside the Linux WSL environment. If you are using Ubuntu 18.04 or newer, running “sudo apt install gpx” in a Linux terminal will do the job. Otherwise, manually install the gpx binary and ensure it has executable permissions.
As for the post-processing script itself, you need it regardless of whether you use OctoPrint or not.
Upgrading from a previous release
Since version 2.4 of the config bundle, upgrading the script is as simple as replacing the .pl file and keeping your current .txt configuration file. Should there ever be a change like a new config item, I will mention it in a release notes file, but so far there is none.
When upgrading, do repeat ‘Step 2’ and ‘Step 3’ below, to have the latest G-code and improved print settings.
How to deploy and configure the script
The workflow depends on your operating system and how you want to run the script.
- You are running Linux or MacOS: copy both
make_fcp_x3g files (.pl and .txt) to a directory whose location will never change. A suitable location would be a ‘bin’ folder in your home directory where you might also store other personal executable files.
Open make_fcp_x3g.txt in a text editor and modify it according to its instructions. When done, ensure the make_fcp_x3g.pl file is executable (chmod a+x make_fcp_x3g.pl) and remember the full absolute path to where you placed it. This will be referred to as PATH below. (An easy way to obtain the absolute path in Mac OS and many recent Linux UIs, is to drag the file into a terminal window.)
Try running the script in a terminal with -c argument to see whether you configured it correctly. In Linux, you may need to install the File::Which Perl module (sudo apt install libfile-which-perl in Debian or Ubuntu; sudo dnf install perl-File-Which in Fedora and the like).
You can now skip the rest of this chapter and move to ‘Step 2.’
- You use a Perl interpreter in Windows: this is the easiest way to use the script in Windows. I recommend Strawberry Perl. Copy both
make_fcp_x3g files (.pl and .txt) to a directory whose location will never change, and where you have write permissions. A subdirectory of your user home folder is a good place (a Windows system directory is not).
Open make_fcp_x3g.txt in a text editor (I recommend Notepad++). Modify it according to its instructions. When done, figure out the full paths to both the Perl executable and the make_fcp_x3g.pl script. To obtain what will be referred to as PATH below, put the perl.exe path between double quotes, followed by a space, then the script path between double quotes. For instance if you installed Strawberry Perl in its default location, then PATH would look like:
"C:\Strawberry\perl\bin\perl.exe" "C:\path\to\make_fcp_x3g.pl"
or if you would be using 64-bit Cygwin:
"C:\cygwin64\bin\perl.exe" "C:\path\to\make_fcp_x3g.pl"
Try running the script in a command shell with -c argument to see whether you configured it correctly. Just paste your value of PATH into a cmd shell and append -c at the end with a space before it. Fix any problems until it reports “OK.”
You can now move to ‘Step 2.’
- You are running WSL inside Windows: this is more complicated but if you already have WSL and have some experience with it, then it makes more sense to rely on its Perl (and maybe Python) interpreter than to install yet another one in Windows. You need the
make_fcp_x3g.pl script, but also a BAT wrapper script to invoke it from within Windows. Follow the ‘WSL instructions’ subsection below.
The above list is sorted from most to least recommended when it comes to ease and functionality. This indeed means that if you have the choice between either, then Linux or Mac OS are preferable over Windows when it comes to running PrusaSlicer with these post-processing scripts.
WSL instructions
This is only relevant if you want to run the scripts inside WSL. Otherwise, skip to ‘Step 2.’
For this to work, inside your WSL environment you must have a command wslpath that converts Windows paths to their Linux equivalent. This is automatically the case if you have Windows 10 version 1803 or newer with a standard WSL image. If not, follow the instructions in the file poor_mans_wslpath.txt. Your WSL version must also support the WSLPATH variable, which should be the case for any recent build.
Copy both make_fcp_x3g files (.pl and .txt) to the same location of your choice inside the WSL environment, pick a directory whose path will never change. Open make_fcp_x3g.txt in a text editor and modify it according to its instructions. Important: everything will run inside WSL, therefore each time you need to specify the path to a program or script, specify the Linux file path where you placed that program (e.g. gpx) or script inside the WSL Linux environment.
When done, ensure both the script and gpx binary (if needed) are executable (chmod a+x make_fcp_x3g.pl).
You should now run the script with -c argument to check whether it works. It is possible you will have to install the File::Which Perl module, which can be done in Ubuntu with:
sudo apt install libfile-which-perl
Now create a BAT wrapper script in your Windows filesystem, any text editor will do. Save the following content under the file name slic3r_postprocess.bat:
set fpath=%~1
set fpath=%fpath:'='$'\'''%
set WSLENV=SLIC3R_PP_OUTPUT_NAME/up
bash -c "perl '/your/linux/path/to/make_fcp_x3g.pl' -w '%fpath%'"
In the above lines, replace “/your/linux/path/to” with the full UNIX style path where you placed the make_fcp_x3g.pl script inside the Linux environment. Avoid having spaces, quotes, $, or other terminal-unfriendly characters in this path unless you know how to deal with them. (Regarding special characters: the cryptic second line in the BAT file makes it safe to use spaces and '