New [print_preset], [filament_preset] and [printer_preset] variables. #675

This commit is contained in:
Alessandro Ranellucci 2012-09-12 15:29:44 +02:00
parent 4fbb8ffb9d
commit 757515ba17
2 changed files with 4 additions and 0 deletions

View File

@ -475,6 +475,8 @@ sub export_gcode {
# set this before spawning the thread because ->config needs GetParent and it's not available there
$self->{print}->config($self->skeinpanel->config);
$self->{print}->extra_variables->{"${_}_preset"} = $self->skeinpanel->{options_tabs}{$_}->current_preset->{name}
for qw(print filament printer);
# select output file
$self->{output_file} = $main::opt{output};

View File

@ -11,6 +11,7 @@ use Slic3r::Geometry::Clipper qw(diff_ex union_ex intersection_ex offset JT_ROUN
use Time::HiRes qw(gettimeofday tv_interval);
has 'config' => (is => 'rw', default => sub { Slic3r::Config->new_from_defaults }, trigger => 1);
has 'extra_variables' => (is => 'rw', default => sub {{}});
has 'objects' => (is => 'rw', default => sub {[]});
has 'copies' => (is => 'rw', default => sub {[]}); # obj_idx => [copies...]
has 'total_extrusion_length' => (is => 'rw');
@ -808,6 +809,7 @@ sub expanded_output_filepath {
return $Slic3r::Config->replace_options($path, {
input_filename => $input_filename,
input_filename_base => $input_filename_base,
%{ $self->extra_variables },
});
}