mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 04:31:15 -06:00 
			
		
		
		
	FIX: allow smooth timelapse without wipe tower
Change-Id: I60d487faa96641dbf88f5502d2fa9ccb83e622c6 (cherry picked from commit 0286a7add9c698a2efd6d40910d72a83f06edba5)
This commit is contained in:
		
							parent
							
								
									a3dcc40f23
								
							
						
					
					
						commit
						f996eedf49
					
				
					 5 changed files with 14 additions and 27 deletions
				
			
		|  | @ -1730,13 +1730,13 @@ void Print::finalize_first_layer_convex_hull() | |||
| // Wipe tower support.
 | ||||
| bool Print::has_wipe_tower() const | ||||
| { | ||||
|     if (enable_timelapse_print()) | ||||
|         return true; | ||||
|     if (m_config.enable_prime_tower.value == true) { | ||||
|         if (enable_timelapse_print()) | ||||
|             return true; | ||||
| 
 | ||||
|     return | ||||
|         ! m_config.spiral_mode.value && | ||||
|         m_config.enable_prime_tower.value && | ||||
|         m_config.filament_diameter.values.size() > 1; | ||||
|         return !m_config.spiral_mode.value && m_config.filament_diameter.values.size() > 1; | ||||
|     } | ||||
|     return false; | ||||
| } | ||||
| 
 | ||||
| const WipeTowerData& Print::wipe_tower_data(size_t filaments_cnt) const | ||||
|  |  | |||
|  | @ -3728,10 +3728,7 @@ void DynamicPrintConfig::normalize_fdm(int used_filaments) | |||
| 
 | ||||
|         ConfigOptionEnum<TimelapseType>* timelapse_opt = this->option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|         bool is_smooth_timelapse = timelapse_opt != nullptr && timelapse_opt->value == TimelapseType::tlSmooth; | ||||
|         if (is_smooth_timelapse) { | ||||
|             ept_opt->value = true; | ||||
|         } | ||||
|         else if (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject) { | ||||
|         if (!is_smooth_timelapse && (used_filaments == 1 || ps_opt->value == PrintSequence::ByObject)) { | ||||
|             ept_opt->value = false; | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
|  | @ -3085,8 +3085,8 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p | |||
| 
 | ||||
|         const double max_z = print.objects()[0]->model_object()->get_model()->bounding_box().max(2); | ||||
|         const PrintConfig& config = print.config(); | ||||
|         if (print.enable_timelapse_print() | ||||
|             || (extruders_count > 1 && config.enable_prime_tower && (config.print_sequence == PrintSequence::ByLayer))) { | ||||
|         if (config.enable_prime_tower &&  | ||||
|             (print.enable_timelapse_print() || (extruders_count > 1 && (config.print_sequence == PrintSequence::ByLayer)))) { | ||||
|             const float depth = print.wipe_tower_data(extruders_count).depth; | ||||
|             const float brim_width = print.wipe_tower_data(extruders_count).brim_width; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1935,7 +1935,7 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re | |||
|         auto timelapse_type = dconfig.option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|         bool timelapse_enabled = timelapse_type ? (timelapse_type->value == TimelapseType::tlSmooth) : false; | ||||
| 
 | ||||
|         if (timelapse_enabled || (filaments_count > 1 && wt && co != nullptr && co->value != PrintSequence::ByObject)) { | ||||
|         if ((timelapse_enabled && wt) || (filaments_count > 1 && wt && co != nullptr && co->value != PrintSequence::ByObject)) { | ||||
|             for (int plate_id = 0; plate_id < n_plates; plate_id++) { | ||||
|                 DynamicPrintConfig& proj_cfg = wxGetApp().preset_bundle->project_config; | ||||
|                 float x = dynamic_cast<const ConfigOptionFloats*>(proj_cfg.option("wipe_tower_x"))->get_at(plate_id); | ||||
|  |  | |||
|  | @ -1380,19 +1380,14 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|         auto timelapse_type = m_config->option<ConfigOptionEnum<TimelapseType>>("timelapse_type"); | ||||
|         bool timelapse_enabled = timelapse_type->value == TimelapseType::tlSmooth; | ||||
|         if (!boost::any_cast<bool>(value) && timelapse_enabled) { | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by timeplase. Are you sure you want to disable both of them?"), | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by smooth timeplase. If whthout prime tower, there will be flaws on the model. Are you sure you want to disable prime tower?"), | ||||
|                               _L("Warning"), wxICON_WARNING | wxYES | wxNO); | ||||
|             if (dlg.ShowModal() == wxID_YES) { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|                 new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(TimelapseType::tlNone)); | ||||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|                 wxGetApp().plater()->update(); | ||||
|             } | ||||
|             else { | ||||
|             if (dlg.ShowModal() == wxID_NO) { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|                 new_conf.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); | ||||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|             } | ||||
|             wxGetApp().plater()->update(); | ||||
|         } | ||||
|         update_wiping_button_visibility(); | ||||
|     } | ||||
|  | @ -1401,7 +1396,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|     if (opt_key == "timelapse_type") { | ||||
|         bool wipe_tower_enabled = m_config->option<ConfigOptionBool>("enable_prime_tower")->value; | ||||
|         if (!wipe_tower_enabled && boost::any_cast<int>(value) == int(TimelapseType::tlSmooth)) { | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by timelapse. Do you want to enable both of them?"), | ||||
|             MessageDialog dlg(wxGetApp().plater(), _L("Prime tower is required by smooth timelapse. If whthout prime tower, there will be flaws on the model. Do you want to enable prime tower?"), | ||||
|                               _L("Warning"), wxICON_WARNING | wxYES | wxNO); | ||||
|             if (dlg.ShowModal() == wxID_YES) { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|  | @ -1409,11 +1404,6 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value) | |||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|                 wxGetApp().plater()->update(); | ||||
|             } | ||||
|             else { | ||||
|                 DynamicPrintConfig new_conf = *m_config; | ||||
|                 new_conf.set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(TimelapseType::tlNone)); | ||||
|                 m_config_manipulation.apply(m_config, &new_conf); | ||||
|             } | ||||
|         } else { | ||||
|             wxGetApp().plater()->update(); | ||||
|         } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 zhimin.zeng
						zhimin.zeng