Skip to content

Commit

Permalink
make sure skydome light is not turned off unexpectedly
Browse files Browse the repository at this point in the history
  • Loading branch information
lilike-adsk committed Jan 18, 2024
1 parent ba01e6e commit 83eb5b1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,18 @@ 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>(
[&](MayaHydraLightAdapter* a) {
auto lgtAdapter = activeLightPaths.find(a->GetDagPath().fullPathName().asChar());
if (lgtAdapter != activeLightPaths.end()) {
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);
Expand Down

0 comments on commit 83eb5b1

Please sign in to comment.