Tech ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES - Fixed orientation for sidebar hints in 3D scene for part manipulation in instance and local systems

This commit is contained in:
enricoturri1966 2021-11-03 15:01:24 +01:00
parent 41fc0be32a
commit 855bf4acfd
2 changed files with 8 additions and 1 deletions

View File

@ -1445,6 +1445,11 @@ void Sidebar::update_mode()
wxWindowUpdateLocker noUpdates(this);
#if ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES
if (m_mode == comSimple)
p->object_manipulation->set_coordinates_type(ObjectManipulation::ECoordinatesType::World);
#endif // ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES
p->object_list->get_sizer()->Show(m_mode > comSimple);
p->object_list->unselect_objects();

View File

@ -1397,11 +1397,13 @@ void Selection::render_sidebar_hints(const std::string& sidebar_field) const
#if ENABLE_WORLD_COORDINATE
#if ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES
if (!wxGetApp().obj_manipul()->is_world_coordinates()) {
Transform3d orient_matrix = Transform3d::Identity();
if (wxGetApp().obj_manipul()->is_local_coordinates()) {
#else
if (!wxGetApp().obj_manipul()->get_world_coordinates()) {
#endif // ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES
Transform3d orient_matrix = Transform3d::Identity();
if (boost::starts_with(sidebar_field, "scale")) {
#endif // ENABLE_INSTANCE_COORDINATES_FOR_VOLUMES
const GLVolume* v = (*m_volumes)[*m_list.begin()];
orient_matrix = v->get_instance_transformation().get_matrix(true, false, true, true) * v->get_volume_transformation().get_matrix(true, false, true, true);
}