mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	Fix: forbid the filament setting to negative/enforcer/blocker
Change-Id: I846ad591c9967af1df3e47c1d007958cf0846766
This commit is contained in:
		
							parent
							
								
									bb4d537991
								
							
						
					
					
						commit
						9f749b304c
					
				
					 2 changed files with 17 additions and 1 deletions
				
			
		|  | @ -1342,6 +1342,12 @@ void MenuFactory::append_menu_item_change_filament(wxMenu* menu) | |||
|     if (sels.IsEmpty()) | ||||
|         return; | ||||
| 
 | ||||
|     if (sels.Count() == 1) { | ||||
|         const auto sel_vol = obj_list()->get_selected_model_volume(); | ||||
|         if (sel_vol && sel_vol->type() != ModelVolumeType::MODEL_PART && sel_vol->type() != ModelVolumeType::PARAMETER_MODIFIER) | ||||
|             return; | ||||
|     } | ||||
| 
 | ||||
|     std::vector<wxBitmap*> icons = get_extruder_color_icons(true); | ||||
|     if (icons.size() < filaments_cnt) { | ||||
|         BOOST_LOG_TRIVIAL(warning) << boost::format("Warning: icons size %1%, filaments_cnt=%2%")%icons.size()%filaments_cnt; | ||||
|  |  | |||
|  | @ -80,7 +80,7 @@ ObjectList::ObjectList(wxWindow* parent) : | |||
| #ifdef __WXMSW__ | ||||
|     GenericGetHeader()->SetFont(Label::sysFont(13)); | ||||
| #endif | ||||
|      | ||||
| 
 | ||||
|     // create control
 | ||||
|     create_objects_ctrl(); | ||||
| 
 | ||||
|  | @ -4805,6 +4805,16 @@ void ObjectList::set_extruder_for_selected_items(const int extruder) | |||
|         ItemType sel_item_type = m_objects_model->GetItemType(sel_item); | ||||
|         wxDataViewItem item = (sel_item_type & itInstance) ? m_objects_model->GetObject(item) : sel_item; | ||||
|         ItemType type = m_objects_model->GetItemType(item); | ||||
|         if (type & itVolume) { | ||||
|             const int obj_idx = m_objects_model->GetObjectIdByItem(item); | ||||
|             const int vol_idx = m_objects_model->GetVolumeIdByItem(item); | ||||
| 
 | ||||
|             if ((obj_idx < m_objects->size()) && (obj_idx < (*m_objects)[obj_idx]->volumes.size())) { | ||||
|                 auto volume_type = (*m_objects)[obj_idx]->volumes[vol_idx]->type(); | ||||
|                 if (volume_type != ModelVolumeType::MODEL_PART && volume_type != ModelVolumeType::PARAMETER_MODIFIER) | ||||
|                     continue; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         ModelConfig& config = get_item_config(item); | ||||
|         if (config.has("extruder")) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 lane.wei
						lane.wei