slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.34k stars 1.29k forks source link

Load the autosaved config.ini through --load or a new --loadlast command #837

Closed thantik closed 11 years ago

thantik commented 11 years ago

I'm currently trying to make my hackerspaces computer so that it's friendly to new users. Right now in order to accomplish this, I'm using a bash script, and setting the HOME variable to /home/%3dprintername%/

This works beautifully, and I'm able to set pronterface up with its own per-machine config, and since pronterface launches slic3r it also retains the HOME variable set, which allows different Slic3r configs to be separated as well. Similar abilities exist in windows and mac.

The problem that arises is that these users don't exactly know what configs are stored where (due to the handful of people that use the machine), and while I could do a --load %someexportedconfig% and instruct them to re-export the config every time they change a setting, there's a chance of them overwriting them, etc. There's also the slightly-inconvenient aspect of constantly having to re-export a config every time. I'm requesting a command-line option that I can pass, to load the stored config.ini that slic3r saves each time it is exited.

What this will allow me and others to do: --loadlast or --load ~/.Slic3r/config.ini (slic3r currently doesn't handle the format that the auto-saved config.ini is in) and load the settings that were last used in the GUI slic3r window.

What it will accomplish: It will allow users who use the slic3r GUI through pronterface to utilize a friendly method in which they change settings. They can rapidly select through the plater dropdown, which options they want, close the window, and load a file through pronterface to have it sliced with those last-chosen options. I'll be posting a nice how-to on how this is accomplished as well so that others can reproduce this.

The only thing this should take to implement is seeing if the --load command is reading the autosaved config.ini, and then traversing the folders lower (which are basically an exported config, just split into sections) and loading those. Optionally, though would be appreciated, a --loadlast could just search for the default autosaved config.ini and use it.

alranel commented 11 years ago

If you launch Slic3r it will automatically load the last presets. Why would we need a --loadlast option?

thantik commented 11 years ago

The command line version doesn't seem to exhibit this functionality you speak of. Pronterface runs the command line version in order to do its slice operation. Whenever pronterface runs slic3r.pl without a --load then slic3r.pl defaults to "-default-" from my tests (git version as of last night)

Is there already functionality built in to load whatever the last selection was in the GUI from the command line?

thantik commented 11 years ago

Is it possible to do something like slic3r.pl --gui --load /lastconfig.ini --save /lastconfig.ini to get this behavior perhaps? So that when closing the window for selected settings, I get a "properly" exported ini file that I can load? I basically just need a way to allow users to not have to deal with, or even worry about having to export a file themselves.

--edit-- apparently doing slic3r.pl --gui with --save just immediately exits, so that doesn't work either. Even if --load could just work on the ~/.Slic3r/config.ini that would be perfect. config.ini lists all the currently gui-selected config files, so as long as --load could chain --load whatever was listed in that saved config.ini (the one that the GUI saves) that would be perfect.

I could always load the separated .ini files myself from the 3 folders, but that defeats the whole purpose of being able to select different dropdowns, etc and would basically restrict me to those 3 presets.

jothan commented 11 years ago

@alexrj When you slice using the command line, Slic3r seems to use default values rather than loading the last presets.

alranel commented 11 years ago

Jothan, yes I know: I designed it that way. :-)

I'm thinking about better ways to integrate Slic3r with host software.

alranel commented 11 years ago

Okay, I implemented a new --autosave option that accepts a file path and automatically exports the full config to it whenever an option is changed in the GUI. This allows flexible toolchain integration because one can launch Slic3r like this:

./slic3r.pl --autosave ~/my_config.ini

and then just load it when slicing from command line:

./slic3r.pl --load ~/my_config.ini foo.stl

The specified file will be sliced using the last selected options in the GUI.

jothan commented 11 years ago

Thanks, this is exactly what I needed !