mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	New option to specify G-code to be used at layer change. #279
This commit is contained in:
		
							parent
							
								
									bf964b5273
								
							
						
					
					
						commit
						1a06e35687
					
				
					 6 changed files with 24 additions and 10 deletions
				
			
		|  | @ -109,6 +109,7 @@ M104 S0 ; turn off temperature | |||
| G28 X0  ; home X axis | ||||
| M84     ; disable motors | ||||
| END | ||||
| our $layer_gcode        = ''; | ||||
| 
 | ||||
| # retraction options | ||||
| our $retract_length         = 1;    # mm | ||||
|  |  | |||
|  | @ -255,7 +255,7 @@ our $Options = { | |||
|         type    => 's', | ||||
|         multiline => 1, | ||||
|         width   => 350, | ||||
|         height  => 150, | ||||
|         height  => 120, | ||||
|         serialize   => sub { join '\n', split /\R+/, $_[0] }, | ||||
|         deserialize => sub { join "\n", split /\\n/, $_[0] }, | ||||
|     }, | ||||
|  | @ -265,7 +265,17 @@ our $Options = { | |||
|         type    => 's', | ||||
|         multiline => 1, | ||||
|         width   => 350, | ||||
|         height  => 150, | ||||
|         height  => 120, | ||||
|         serialize   => sub { join '\n', split /\R+/, $_[0] }, | ||||
|         deserialize => sub { join "\n", split /\\n/, $_[0] }, | ||||
|     }, | ||||
|     'layer_gcode' => { | ||||
|         label   => 'Layer Change GCODE', | ||||
|         cli     => 'layer-gcode=s', | ||||
|         type    => 's', | ||||
|         multiline => 1, | ||||
|         width   => 350, | ||||
|         height  => 50, | ||||
|         serialize   => sub { join '\n', split /\R+/, $_[0] }, | ||||
|         deserialize => sub { join "\n", split /\\n/, $_[0] }, | ||||
|     }, | ||||
|  | @ -475,7 +485,7 @@ sub validate_cli { | |||
|     my $class = shift; | ||||
|     my ($opt) = @_; | ||||
|      | ||||
|     for (qw(start end)) { | ||||
|     for (qw(start end layer)) { | ||||
|         if (defined $opt->{$_."_gcode"}) { | ||||
|             if ($opt->{$_."_gcode"} eq "") { | ||||
|                 set($_."_gcode", ""); | ||||
|  |  | |||
|  | @ -49,6 +49,9 @@ sub change_layer { | |||
|     $gcode .= $self->G0(undef, $z, 0, 'move to next layer') | ||||
|         if $self->z != $z; | ||||
|      | ||||
|     $gcode .= Slic3r::Config->replace_options($Slic3r::layer_gcode) . "\n" | ||||
|         if $Slic3r::layer_gcode; | ||||
|      | ||||
|     return $gcode; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -64,7 +64,7 @@ sub new { | |||
|         }, | ||||
|         gcode => { | ||||
|             title => 'Custom GCODE', | ||||
|             options => [qw(start_gcode end_gcode gcode_comments post_process)], | ||||
|             options => [qw(start_gcode end_gcode layer_gcode gcode_comments post_process)], | ||||
|         }, | ||||
|         extrusion => { | ||||
|             title => 'Extrusion', | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci