diff options
author | Mike Krus <mike.krus@kdab.com> | 2019-11-28 12:26:12 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2019-11-28 13:03:24 +0000 |
commit | b6923f6fa0c01fa47f99f9794a17fe99c5397680 (patch) | |
tree | 1250911eeea08be7333d65a8572627c3716bbbec | |
parent | 7be538bfee06de8ccba751a7bb18e6389afd2626 (diff) |
Restore default rendering behavior of Scene3D
Recent change in Scene3D was made to stop it rendering when it
was hidden. However this means it no longer can be used as a hidden
item in combination with an OpacityMask.
Revert default behavior to always draw and introduce an environment
variable to let the user stop rendering.
5.15 will add a property to control this properly.
Change-Id: I30f95b2704cc7c1c0a4467677c8a9e4e1dbb9962
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r-- | src/quick3d/imports/scene3d/scene3ditem.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp index 5a1cec495..c93d10b64 100644 --- a/src/quick3d/imports/scene3d/scene3ditem.cpp +++ b/src/quick3d/imports/scene3d/scene3ditem.cpp @@ -460,10 +460,12 @@ bool Scene3DItem::needsRender() // processFrame will block and wait for renderer to have been finished void Scene3DItem::onBeforeSync() { + static bool dontRenderWhenHidden = !qgetenv("QT3D_SCENE3D_STOP_RENDER_HIDDEN").isEmpty(); + // If we are not visible, don't processFrame changes as we would end up // waiting forever for the scene to be rendered which won't happen // if the Scene3D item is not visible - if (!isVisible()) + if (!isVisible() && dontRenderWhenHidden) return; // Has anything in the 3D scene actually changed that requires us to render? |