mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Fixed objects name after 3mf import
This commit is contained in:
		
							parent
							
								
									f1224c64ba
								
							
						
					
					
						commit
						d590661d40
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -342,6 +342,7 @@ namespace Slic3r { | |||
|         IdToSlaSupportPointsMap m_sla_support_points; | ||||
|         std::string m_curr_metadata_name; | ||||
|         std::string m_curr_characters; | ||||
|         std::string m_name; | ||||
| 
 | ||||
|     public: | ||||
|         _3MF_Importer(); | ||||
|  | @ -444,6 +445,7 @@ namespace Slic3r { | |||
|         , m_unit_factor(1.0f) | ||||
|         , m_curr_metadata_name("") | ||||
|         , m_curr_characters("") | ||||
|         , m_name("") | ||||
|     { | ||||
|     } | ||||
| 
 | ||||
|  | @ -505,6 +507,8 @@ namespace Slic3r { | |||
| 
 | ||||
|         mz_zip_archive_file_stat stat; | ||||
| 
 | ||||
|         m_name = boost::filesystem::path(filename).filename().stem().string(); | ||||
| 
 | ||||
|         // we first loop the entries to read from the archive the .model file only, in order to extract the version from it
 | ||||
|         for (mz_uint i = 0; i < num_entries; ++i) | ||||
|         { | ||||
|  | @ -1051,6 +1055,9 @@ namespace Slic3r { | |||
| 
 | ||||
|             // set object data
 | ||||
|             m_curr_object.object->name = get_attribute_value_string(attributes, num_attributes, NAME_ATTR); | ||||
|             if (m_curr_object.object->name.empty()) | ||||
|                 m_curr_object.object->name = m_name + "_" + std::to_string(m_model->objects.size()); | ||||
| 
 | ||||
|             m_curr_object.id = get_attribute_value_int(attributes, num_attributes, ID_ATTR); | ||||
|         } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Enrico Turri
						Enrico Turri