Place to bed now rotates all instances the same way, regardless of which one was selected

This commit is contained in:
Lukas Matena 2019-01-04 21:34:25 +01:00
parent 7ef10e9663
commit 60926e7be3
2 changed files with 6 additions and 5 deletions

View File

@ -1700,8 +1700,10 @@ void GLCanvas3D::Selection::flattening_rotate(const Vec3d& normal)
}
#if !DISABLE_INSTANCES_SYNCH
// we want to synchronize z-rotation as well, otherwise the flattening behaves funny
// when applied on one of several identical instances
if (m_mode == Instance)
_synchronize_unselected_instances();
_synchronize_unselected_instances(true);
#endif // !DISABLE_INSTANCES_SYNCH
m_bounding_box_dirty = true;
@ -1911,7 +1913,6 @@ void GLCanvas3D::Selection::erase()
{
items.emplace_back(ItemType::itInstance, i.first, i.second);
}
wxGetApp().obj_list()->delete_from_model_and_list(items);
}
else if (is_mixed())
@ -2573,7 +2574,7 @@ void GLCanvas3D::Selection::_render_sidebar_size_hint(Axis axis, double length)
}
#endif // ENABLE_SIDEBAR_VISUAL_HINTS
void GLCanvas3D::Selection::_synchronize_unselected_instances()
void GLCanvas3D::Selection::_synchronize_unselected_instances(bool including_z)
{
std::set<unsigned int> done; // prevent processing volumes twice
done.insert(m_list.begin(), m_list.end());
@ -2606,7 +2607,7 @@ void GLCanvas3D::Selection::_synchronize_unselected_instances()
if ((v->object_idx() != object_idx) || (v->instance_idx() == instance_idx))
continue;
v->set_instance_rotation(Vec3d(rotation(0), rotation(1), v->get_instance_rotation()(2)));
v->set_instance_rotation(Vec3d(rotation(0), rotation(1), including_z ? rotation(2) : v->get_instance_rotation()(2)));
v->set_instance_scaling_factor(scaling_factor);
v->set_instance_mirror(mirror);

View File

@ -597,7 +597,7 @@ public:
void _render_sidebar_scale_hint(Axis axis) const;
void _render_sidebar_size_hint(Axis axis, double length) const;
#endif // ENABLE_SIDEBAR_VISUAL_HINTS
void _synchronize_unselected_instances();
void _synchronize_unselected_instances(bool including_z = false);
void _synchronize_unselected_volumes();
#if ENABLE_ENSURE_ON_BED_WHILE_SCALING
void _ensure_on_bed();