Modified MMU painting gizmo behavior so that all triangles aren't painted by default by the first extruder, which was causing several problems.

This commit also fixed the following issues:
1) After loading a 3MF with painted triangles using the MMU painting gizmo, the painted triangles might not be displayed correctly in the MMU painting gizmo.
2) The MMU segmentation was unnecessarily executed for all layers and not just for the painted layers.
3) Object's base color wasn't changed when the assigned extruder for that object was changed while the MMU paint gizmo was opened.
4) Changing the base color of an object was only possible by removing all painted triangles.
This commit is contained in:
Lukáš Hejl 2021-06-09 08:07:15 +02:00
parent b2677f513c
commit 8a77fa38f0
4 changed files with 51 additions and 30 deletions

View file

@ -50,7 +50,7 @@ public:
void set_facet(int facet_idx, EnforcerBlockerType state);
// Clear everything and make the tree empty.
void reset(const EnforcerBlockerType reset_state = EnforcerBlockerType{0});
void reset();
// Remove all unnecessary data.
void garbage_collect();
@ -60,7 +60,7 @@ public:
std::pair<std::vector<std::pair<int, int>>, std::vector<bool>> serialize() const;
// Load serialized data. Assumes that correct mesh is loaded.
void deserialize(const std::pair<std::vector<std::pair<int, int>>, std::vector<bool>> &data, const EnforcerBlockerType init_state = EnforcerBlockerType{0});
void deserialize(const std::pair<std::vector<std::pair<int, int>>, std::vector<bool>> &data);
// For all triangles, remove the flag indicating that the triangle was selected by seed fill.
void seed_fill_unselect_all_triangles();