Gizmos can be shown depending on current mode

This commit is contained in:
Lukas Matena 2020-08-05 13:30:05 +02:00
parent 4ef52af906
commit 7fd2209b48
3 changed files with 12 additions and 5 deletions

View file

@ -144,8 +144,11 @@ void GLGizmosManager::refresh_on_off_state()
if (m_serializing || m_current == Undefined || m_gizmos.empty())
return;
if (m_current != Undefined && ! m_gizmos[m_current]->is_activable())
if (m_current != Undefined
&& (! m_gizmos[m_current]->is_activable() || ! m_gizmos[m_current]->is_selectable())) {
activate_gizmo(Undefined);
update_data();
}
}
void GLGizmosManager::reset_all_states()
@ -204,9 +207,10 @@ void GLGizmosManager::update_data()
enable_grabber(Scale, i, enable_scale_xyz);
}
m_common_gizmos_data->update(get_current()
? get_current()->get_requirements()
: CommonGizmosDataID(0));
if (m_common_gizmos_data)
m_common_gizmos_data->update(get_current()
? get_current()->get_requirements()
: CommonGizmosDataID(0));
if (selection.is_single_full_instance())
{