mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	Make preset placeholders available in Quick Slice too. #921
This commit is contained in:
		
							parent
							
								
									bde730a611
								
							
						
					
					
						commit
						f7153d67d0
					
				
					 2 changed files with 18 additions and 18 deletions
				
			
		|  | @ -525,7 +525,7 @@ sub export_gcode { | |||
|     } | ||||
|      | ||||
|     # get config before spawning the thread because ->config needs GetParent and it's not available there | ||||
|     my $print = $self->_init_print; | ||||
|     my $print = $self->skeinpanel->init_print; | ||||
|      | ||||
|     # select output file | ||||
|     $self->{output_file} = $main::opt{output}; | ||||
|  | @ -582,21 +582,6 @@ sub export_gcode { | |||
|     } | ||||
| } | ||||
| 
 | ||||
| sub _init_print { | ||||
|     my $self = shift; | ||||
|      | ||||
|     my %extra_variables = (); | ||||
|     if ($self->skeinpanel->{mode} eq 'expert') { | ||||
|         $extra_variables{"${_}_preset"} = $self->skeinpanel->{options_tabs}{$_}->current_preset->{name} | ||||
|             for qw(print filament printer); | ||||
|     } | ||||
|      | ||||
|     return Slic3r::Print->new( | ||||
|         config => $self->skeinpanel->config, | ||||
|         extra_variables => { %extra_variables }, | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| sub export_gcode2 { | ||||
|     my $self = shift; | ||||
|     my ($print, $output_file, %params) = @_; | ||||
|  | @ -687,7 +672,7 @@ sub _get_export_file { | |||
|      | ||||
|     my $output_file = $main::opt{output}; | ||||
|     { | ||||
|         $output_file = $self->_init_print->expanded_output_filepath($output_file, $self->{objects}[0]->input_file); | ||||
|         $output_file = $self->skeinpanel->init_print->expanded_output_filepath($output_file, $self->{objects}[0]->input_file); | ||||
|         $output_file =~ s/\.gcode$/$suffix/i; | ||||
|         my $dlg = Wx::FileDialog->new($self, "Save $format file as:", dirname($output_file), | ||||
|             basename($output_file), &Slic3r::GUI::SkeinPanel::MODEL_WILDCARD, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); | ||||
|  |  | |||
|  | @ -122,7 +122,7 @@ sub do_slice { | |||
|         $Slic3r::GUI::Settings->{recent}{skein_directory} = dirname($input_file); | ||||
|         Slic3r::GUI->save_settings; | ||||
|          | ||||
|         my $print = Slic3r::Print->new(config => $config); | ||||
|         my $print = $self->init_print; | ||||
|         $print->add_model(Slic3r::Model->read_from_file($input_file)); | ||||
|         $print->validate; | ||||
| 
 | ||||
|  | @ -189,6 +189,21 @@ sub do_slice { | |||
|     Slic3r::GUI::catch_error($self, sub { $process_dialog->Destroy if $process_dialog }); | ||||
| } | ||||
| 
 | ||||
| sub init_print { | ||||
|     my $self = shift; | ||||
|      | ||||
|     my %extra_variables = (); | ||||
|     if ($self->{mode} eq 'expert') { | ||||
|         $extra_variables{"${_}_preset"} = $self->{options_tabs}{$_}->current_preset->{name} | ||||
|             for qw(print filament printer); | ||||
|     } | ||||
|      | ||||
|     return Slic3r::Print->new( | ||||
|         config          => $self->config, | ||||
|         extra_variables => { %extra_variables }, | ||||
|     ); | ||||
| } | ||||
| 
 | ||||
| sub export_config { | ||||
|     my $self = shift; | ||||
|      | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci