From 83eb5b119bc6dd78215ae387d6efaa5bd8a7402a Mon Sep 17 00:00:00 2001 From: Keli Li Date: Thu, 18 Jan 2024 10:35:55 -0500 Subject: [PATCH] make sure skydome light is not turned off unexpectedly --- .../hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp index 7e453adfba..548717b0d4 100644 --- a/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp +++ b/lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp @@ -886,7 +886,7 @@ void MayaHydraSceneIndex::PreFrame(const MHWRender::MDrawContext& context) } } - // Turn on active lights, turn off non-active lights, and add non-created active lights. + // Turn on active lights, turn off non-active lights _MapAdapter( [&](MayaHydraLightAdapter* a) { auto lgtAdapter = activeLightPaths.find(a->GetDagPath().fullPathName().asChar()); @@ -894,7 +894,10 @@ void MayaHydraSceneIndex::PreFrame(const MHWRender::MDrawContext& context) a->SetLightingOn(true); activeLightPaths.erase(lgtAdapter); } else { - a->SetLightingOn(false); + // Skip dome light as maya numberOfActiveLights API doesn't count active dome light + if (a->LightType() != HdPrimTypeTokens->domeLight) { + a->SetLightingOn(false); + } } }, _lightAdapters);