From b0c33a1fe9db68b7121bea9cb8729bcd14299418 Mon Sep 17 00:00:00 2001 From: bubnikv <bubnikv@gmail.com> Date: Fri, 12 Apr 2019 18:29:47 +0200 Subject: [PATCH] Fixed copying of some object's attributes into the clipboard (layer height profile, layer height table etc) Added public Plater::schedule_background_process() --- src/slic3r/GUI/Plater.cpp | 5 +++++ src/slic3r/GUI/Plater.hpp | 1 + src/slic3r/GUI/Selection.cpp | 16 +++++++++++----- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8512011d8..646a2ee64 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -3698,6 +3698,11 @@ void Plater::changed_object(int obj_idx) this->p->schedule_background_process(); } +void Plater::schedule_background_process() +{ + this->p->schedule_background_process(); +} + void Plater::fix_through_netfabb(const int obj_idx, const int vol_idx/* = -1*/) { p->fix_through_netfabb(obj_idx, vol_idx); } void Plater::update_object_menu() { p->update_object_menu(); } diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 708c07f39..30d780e7c 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -162,6 +162,7 @@ public: void reslice(); void reslice_SLA_supports(const ModelObject &object); void changed_object(int obj_idx); + void schedule_background_process(); void fix_through_netfabb(const int obj_idx, const int vol_idx = -1); void send_gcode(); diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 8b80310da..957c04d69 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1033,9 +1033,14 @@ void Selection::copy_to_clipboard() { ModelObject* src_object = m_model->objects[object.first]; ModelObject* dst_object = m_clipboard.add_object(); - dst_object->name = src_object->name; - dst_object->input_file = src_object->input_file; - dst_object->config = src_object->config; + dst_object->name = src_object->name; + dst_object->input_file = src_object->input_file; + dst_object->config = src_object->config; + dst_object->sla_support_points = src_object->sla_support_points; + dst_object->sla_points_status = src_object->sla_points_status; + dst_object->layer_height_ranges = src_object->layer_height_ranges; + dst_object->layer_height_profile = src_object->layer_height_profile; + dst_object->origin_translation = src_object->origin_translation; for (int i : object.second) { @@ -1044,6 +1049,7 @@ void Selection::copy_to_clipboard() for (unsigned int i : m_list) { + // Copy the ModelVolumes only for the selected GLVolumes of the 1st selected instance. const GLVolume* volume = (*m_volumes)[i]; if ((volume->object_idx() == object.first) && (volume->instance_idx() == *object.second.begin())) { @@ -1053,7 +1059,8 @@ void Selection::copy_to_clipboard() ModelVolume* src_volume = src_object->volumes[volume_idx]; ModelVolume* dst_volume = dst_object->add_volume(*src_volume); dst_volume->set_new_unique_id(); - dst_volume->config = src_volume->config; + } else { + assert(false); } } } @@ -1776,7 +1783,6 @@ void Selection::paste_volumes_from_clipboard() for (ModelVolume* src_volume : src_object->volumes) { ModelVolume* dst_volume = dst_object->add_volume(*src_volume); - dst_volume->config = src_volume->config; dst_volume->set_new_unique_id(); double offset = wxGetApp().plater()->canvas3D()->get_size_proportional_to_max_bed_size(0.05); dst_volume->translate(offset, offset, 0.0);