mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	GCode.cpp: Update the 'current_extruder' placeholder even if filament start gcode is empty
This commit is contained in:
		
							parent
							
								
									69f81120e0
								
							
						
					
					
						commit
						cf3b992269
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		|  | @ -201,12 +201,13 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T | |||
|     // Let the m_writer know the current extruder_id, but ignore the generated G-code.
 | ||||
| 	if (new_extruder_id >= 0 && gcodegen.writer().need_toolchange(new_extruder_id)) | ||||
|         gcodegen.writer().toolchange(new_extruder_id); | ||||
|     gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); | ||||
| 
 | ||||
|     // Always append the filament start G-code even if the extruder did not switch,
 | ||||
|     // because the wipe tower resets the linear advance and we want it to be re-enabled.
 | ||||
|     const std::string &start_filament_gcode = gcodegen.config().start_filament_gcode.get_at(new_extruder_id); | ||||
|     if (! start_filament_gcode.empty()) { | ||||
|         // Process the start_filament_gcode for the active filament only.
 | ||||
|         gcodegen.placeholder_parser().set("current_extruder", new_extruder_id); | ||||
|         DynamicConfig config; | ||||
|         config.set_key_value("filament_extruder_id", new ConfigOptionInt(new_extruder_id)); | ||||
|         gcode += gcodegen.placeholder_parser_process("start_filament_gcode", start_filament_gcode, new_extruder_id, &config); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lukas Matena
						Lukas Matena