diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-09-17 17:19:42 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-09-18 07:51:30 +0000 |
commit | 3a5526832503e677e477b683ecdf43b1b5fe24fb (patch) | |
tree | 8b281854d32bba890823a4afe3edc075b7554214 | |
parent | e978f6d82791ffc7517822e22f7e661bb6261e1b (diff) |
Hide manipulation widgets from inactive objects
Manipulation widgets are hidden for items that are not currently
active, i.e. their eyeball is off or playhead is outside their
timeline bar. Bounding box is still shown also for hidden objects.
Task-number: QT3DS-2341
Change-Id: Iaf0b7be158d76ddedb5e2216aa5f136d5a12c896
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Authoring/Studio/Render/StudioRendererTranslation.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp index 17f2924b..4feb54c5 100644 --- a/src/Authoring/Studio/Render/StudioRendererTranslation.cpp +++ b/src/Authoring/Studio/Render/StudioRendererTranslation.cpp @@ -2489,9 +2489,17 @@ void STranslation::Render(int inWidgetId, bool inDrawGuides, bool scenePreviewPa qt3ds::render::SNode &theNode( static_cast<qt3ds::render::SNode &>(theTranslator->GetGraphObject())); + const GraphObjectTypes::Enum type = theTranslator->GetGraphObject().m_Type; + + // Don't draw widgets for non-visible nodes + bool isActive = theNode.m_Flags.IsActive(); + // Light and camera nodes are never active, so check from doc + if (type == GraphObjectTypes::Camera || type == GraphObjectTypes::Light) + isActive = m_Reader.IsCurrentlyActive(theHandles[0]); + shouldDisplayWidget = shouldDisplayWidget && isActive; + SCamera *theRenderCamera = m_Context.GetRenderer().GetCameraForNode(theNode); bool isActiveCamera = theRenderCamera == (static_cast<SCamera *>(&theNode)); - const GraphObjectTypes::Enum type = theTranslator->GetGraphObject().m_Type; if (shouldDisplayWidget && !isActiveCamera && ((type == GraphObjectTypes::Camera && m_EditCameraEnabled) || type != GraphObjectTypes::Camera)) { |