Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrusaSlicer Console --load my_config.ini doesnt overwrites the 3mf profiles or not used. #3893

Closed
tixenre opened this issue Mar 22, 2020 · 3 comments

Comments

@tixenre
Copy link

tixenre commented Mar 22, 2020

PrusaSlicer 2.2.0

Windows 10 64 bit

I'm writing a script in Python 3.82 for batch file slicing to calculate cost and times.

My coding skills are basic and it is my first project. Anyways I'm able to slice a .stl from the command prompt on windows and from the script without issues.

What I'm trying to do but the --load .ini doest work

f = Path(r'3mf\Sonic.3mf')  ##file
p = Path(r'PrusaSlicer\presets\print\2.ini') ## print profile 0.2mm
i = Path(r'PrusaSlicer\presets\filament\PLA.ini') ## print filament PLA
pp = Path(r'PrusaSlicer\presets\printer\def.ini') ## printer mk3s
s = f'{slicer_console}  -g {f2} --load {p} --load {i} --load {pp}'
subprocess.call(s, cwd=cwd)

The .3mf is sliced, but the files profiles are not modified or not used
In most cases, I can use a .STL exported from a .3MF, but it would be graet to keep all custom supports, and custom parameters of each file.

How I ended up doing it

f1 = Path(r'3mf\Sonic.3mf') ## 3mf File
s1 = f'{slicer_console}  ---export-stl {f1}' 
subprocess.call(s1, cwd=cwd) ## export stl
f2 = Path(r'3mf\Sonic.stl') ## stl exported
p = Path(r'PrusaSlicer\presets\print\2.ini') ## print profile 0.2mm
pp = Path(r'PrusaSlicer\presets\printer\def.ini')  ## print filament PLA
i = Path(r'PrusaSlicer\presets\filament\PLA.ini') ## printer mk3s
s2 = f'{slicer_console}  -g {f2} --load {p} --load {i} --load {pp}'
subprocess.call(s2, cwd=cwd)

NOTE: My profiles.ini are in PrusaSlicer/presets

I'm not sure if I'm missing something in my code or it there is a real issue.
Any comment about would help me a lot and if I have to provide more information about the code let me know
Cheers,
Martin Santini

@bubnikv
Copy link
Collaborator

bubnikv commented Mar 23, 2020 via email

@tixenre
Copy link
Author

tixenre commented Mar 23, 2020

I think there is a misunderstanding, the files profiles are not to be
modified by PrusaSlicer when slicing.

Well, maybe the profiles that I pass are not used, I didn't mean that the PrusaSlicer profiles are modified.

PrusaSlicer loads all the configs in the sequence they are declared.
Then it loads the 3mf, then it applies the configs loaded before over the
configs stored in the 3MF.

I understand that if I load a profile in the command line, it should use it despite of the profile in the 3mf. I know that Slic3r was coded before the .3mf mainstream usage. If I would know C++ I would try to take a look and even propose a fix.
Maybe I'm wrong and there is another way to do what I'm trying to do.

@tixenre tixenre changed the title PrusaSlicer Console --load my_config.ini doesnt overwrites the 3mf profiles. PrusaSlicer Console --load my_config.ini doesnt overwrites the 3mf profiles or not used. Mar 23, 2020
bubnikv added a commit that referenced this issue Mar 24, 2020
from command line. Fixes
PrusaSlicer Console --load my_config.ini doesnt overwrites the 3mf profiles or not used. #3893

The priority of config values is now:

1) Config keys from command line, for example --fill-pattern=stars
   (highest priority, overwrites everything below)
2) Config files loaded with --load
3) Config from 3mf
   (lowest priority)
bubnikv added a commit that referenced this issue Mar 24, 2020
from command line to command line help.
Follow up on
PrusaSlicer Console --load my_config.ini doesnt overwrites the 3mf profiles or not used. #3893
@bubnikv
Copy link
Collaborator

bubnikv commented Mar 24, 2020

Fixed with 015a4a3 and c3a9915

The priority of config values is now:

1) Config keys from command line, for example --fill-pattern=stars
   (highest priority, overwrites everything below)
2) Config files loaded with --load
3) Config from 3mf
   (lowest priority)

@bubnikv bubnikv closed this as completed Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants