mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-05-15 14:58:08 +08:00
Pass config options as environment variables to post-processing scripts
This commit is contained in:
parent
62bd33a766
commit
3e94add8a8
@ -528,6 +528,16 @@ sub save {
|
|||||||
close $fh;
|
close $fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub setenv {
|
||||||
|
my $class = shift;
|
||||||
|
foreach my $opt (sort keys %$Options) {
|
||||||
|
next if $Options->{$opt}{gui_only};
|
||||||
|
my $value = get($opt);
|
||||||
|
$value = $Options->{$opt}{serialize}->($value) if $Options->{$opt}{serialize};
|
||||||
|
$ENV{"SLIC3R_" . uc $opt} = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub load {
|
sub load {
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
my ($file) = @_;
|
my ($file) = @_;
|
||||||
|
@ -311,6 +311,7 @@ sub export_gcode {
|
|||||||
# run post-processing scripts
|
# run post-processing scripts
|
||||||
if (@$Slic3r::post_process) {
|
if (@$Slic3r::post_process) {
|
||||||
$status_cb->(95, "Running post-processing scripts");
|
$status_cb->(95, "Running post-processing scripts");
|
||||||
|
Slic3r::Config->setenv;
|
||||||
for (@$Slic3r::post_process) {
|
for (@$Slic3r::post_process) {
|
||||||
Slic3r::debugf " '%s' '%s'\n", $_, $output_file;
|
Slic3r::debugf " '%s' '%s'\n", $_, $output_file;
|
||||||
system($_, $output_file);
|
system($_, $output_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user