Skip to content

Commit

Permalink
[#2025] Fixed the instances not transforming in global space when the…
Browse files Browse the repository at this point in the history
… plate is duplicated.
  • Loading branch information
eoyilmaz committed Jun 14, 2024
1 parent 40d26d8 commit 6a6804d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slic3r/GUI/PartPlate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3616,14 +3616,14 @@ int PartPlateList::duplicate_plate(int index)
for (ModelObject* object : obj_ptrs){
// copy and move the object to the same relative position in the new plate
ModelObject* object_copy = m_model->add_object(*object);
object_copy->translate(plate_to_plate_offset);
int new_obj_id = new_plate->m_model->objects.size() - 1;
// go over the instances and pair with the object
for (size_t new_instance_id = 0; new_instance_id < object_copy->instances.size(); new_instance_id++){
new_plate->obj_to_instance_set.emplace(std::pair(new_obj_id, new_instance_id));
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": duplicate object into plate: index_pair [%1%,%2%], obj_id %3%") % new_obj_id % new_instance_id % object_copy->id().id;
}
}
new_plate->translate_all_instance(plate_to_plate_offset);
// update the plates
wxGetApp().obj_list()->reload_all_plates();
return new_plate_index;
Expand Down

0 comments on commit 6a6804d

Please sign in to comment.