ENH: refine the color painting logics
1. optimize color painting performance 2. fix the issue that painting does not show if moving fast after bucket fill Signed-off-by: yifan.wu <yifan.wu@bambulab.com> Change-Id: I72204aac81b14c87edb602677abeef13ee0fad8f (cherry picked from commit 02560f31c413cb561800fca242f8ef30504d0384)
This commit is contained in:
parent
988910f986
commit
9df3e7500a
|
@ -175,6 +175,10 @@ void GLGizmoFdmSupports::on_set_state()
|
|||
if (get_state() == On) {
|
||||
m_support_threshold_angle = -1;
|
||||
}
|
||||
else if (get_state() == Off) {
|
||||
ModelObject* mo = m_c->selection_info()->model_object();
|
||||
if (mo) Slic3r::save_object_mesh(*mo);
|
||||
}
|
||||
}
|
||||
|
||||
static std::string into_u8(const wxString& str)
|
||||
|
@ -552,8 +556,6 @@ void GLGizmoFdmSupports::update_model_object()
|
|||
const ModelObjectPtrs& mos = wxGetApp().model().objects;
|
||||
wxGetApp().obj_list()->update_info_items(std::find(mos.begin(), mos.end(), mo) - mos.begin());
|
||||
|
||||
// BBS: backup
|
||||
Slic3r::save_object_mesh(*mo);
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
||||
}
|
||||
|
||||
|
|
|
@ -663,11 +663,7 @@ void GLGizmoMmuSegmentation::update_model_object()
|
|||
if (updated) {
|
||||
const ModelObjectPtrs &mos = wxGetApp().model().objects;
|
||||
wxGetApp().obj_list()->update_info_items(std::find(mos.begin(), mos.end(), mo) - mos.begin());
|
||||
// BBS: backup
|
||||
Slic3r::save_object_mesh(*mo);
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
||||
// BBS
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_FORCE_UPDATE));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -756,6 +752,16 @@ std::array<float, 4> GLGizmoMmuSegmentation::get_cursor_hover_color() const
|
|||
return m_extruders_colors[0];
|
||||
}
|
||||
|
||||
void GLGizmoMmuSegmentation::on_set_state()
|
||||
{
|
||||
GLGizmoPainterBase::on_set_state();
|
||||
|
||||
if (get_state() == Off) {
|
||||
ModelObject* mo = m_c->selection_info()->model_object();
|
||||
if (mo) Slic3r::save_object_mesh(*mo);
|
||||
}
|
||||
}
|
||||
|
||||
wxString GLGizmoMmuSegmentation::handle_snapshot_action_name(bool shift_down, GLGizmoPainterBase::Button button_down) const
|
||||
{
|
||||
wxString action_name;
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
protected:
|
||||
// BBS
|
||||
std::array<float, 4> get_cursor_hover_color() const override;
|
||||
void on_set_state() override;
|
||||
|
||||
EnforcerBlockerType get_left_button_state_type() const override { return EnforcerBlockerType(m_selected_extruder_idx + 1); }
|
||||
EnforcerBlockerType get_right_button_state_type() const override { return EnforcerBlockerType::NONE; }
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
void request_update_render_data(bool paint_changed = false)
|
||||
{
|
||||
m_update_render_data = true;
|
||||
m_paint_changed = paint_changed;
|
||||
m_paint_changed |= paint_changed;
|
||||
};
|
||||
|
||||
// BBS
|
||||
|
|
|
@ -320,6 +320,17 @@ void GLGizmoSeam::on_render_input_window(float x, float y, float bottom_limit)
|
|||
ImGuiWrapper::pop_toolbar_style();
|
||||
}
|
||||
|
||||
// BBS
|
||||
void GLGizmoSeam::on_set_state()
|
||||
{
|
||||
GLGizmoPainterBase::on_set_state();
|
||||
|
||||
if (get_state() == Off) {
|
||||
ModelObject* mo = m_c->selection_info()->model_object();
|
||||
if (mo) Slic3r::save_object_mesh(*mo);
|
||||
}
|
||||
}
|
||||
|
||||
//BBS: remove const
|
||||
void GLGizmoSeam::update_model_object()
|
||||
{
|
||||
|
@ -336,9 +347,6 @@ void GLGizmoSeam::update_model_object()
|
|||
if (updated) {
|
||||
const ModelObjectPtrs& mos = wxGetApp().model().objects;
|
||||
wxGetApp().obj_list()->update_info_items(std::find(mos.begin(), mos.end(), mo) - mos.begin());
|
||||
|
||||
// BBS: backup
|
||||
Slic3r::save_object_mesh(*mo);
|
||||
m_parent.post_event(SimpleEvent(EVT_GLCANVAS_SCHEDULE_BACKGROUND_PROCESS));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,9 @@ public:
|
|||
void render_painter_gizmo() const override;
|
||||
|
||||
protected:
|
||||
// BBS
|
||||
void on_set_state() override;
|
||||
|
||||
wchar_t m_current_tool = 0;
|
||||
void on_render_input_window(float x, float y, float bottom_limit) override;
|
||||
std::string on_get_name() const override;
|
||||
|
|
Loading…
Reference in New Issue