mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	ENH: CLI: add more logic to support repetitions
1. add identify_id for those clone objects 2. ensure succuss when copy multiple objects Change-Id: I8a92f485442577ce70b1f5c46449dae1ae07b713
This commit is contained in:
		
							parent
							
								
									468fc828d0
								
							
						
					
					
						commit
						db5ed65577
					
				
					 2 changed files with 460 additions and 338 deletions
				
			
		| 
						 | 
				
			
			@ -2146,6 +2146,24 @@ void PartPlate::duplicate_all_instance(unsigned int dup_count, bool need_skip, s
 | 
			
		|||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    for (std::set<std::pair<int, int>>::iterator it = obj_to_instance_set.begin(); it != obj_to_instance_set.end(); ++it)
 | 
			
		||||
    {
 | 
			
		||||
        int obj_id = it->first;
 | 
			
		||||
        int instance_id = it->second;
 | 
			
		||||
 | 
			
		||||
        if ((obj_id >= 0) && (obj_id < m_model->objects.size()))
 | 
			
		||||
        {
 | 
			
		||||
            ModelObject* object = m_model->objects[obj_id];
 | 
			
		||||
            ModelInstance* instance = object->instances[instance_id];
 | 
			
		||||
 | 
			
		||||
            if (instance->printable)
 | 
			
		||||
            {
 | 
			
		||||
                instance->loaded_id = instance->id().id;
 | 
			
		||||
                BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": set obj %1% instance %2%'s loaded_id to its id %3%, name %4%") % obj_id %instance_id %instance->loaded_id  % object->name;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue