From e019a716397fbdaf19379e912c0756e2a138382b Mon Sep 17 00:00:00 2001 From: aclegg3 Date: Mon, 19 Aug 2024 11:40:35 -0700 Subject: [PATCH] reset should change the default lighting key to point to the scene instance defined light setup --- src/esp/sim/Simulator.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/esp/sim/Simulator.cpp b/src/esp/sim/Simulator.cpp index e7e94f9b8b..6b90418c85 100644 --- a/src/esp/sim/Simulator.cpp +++ b/src/esp/sim/Simulator.cpp @@ -680,7 +680,13 @@ void Simulator::reset() { agent->reset(); } getActiveSceneGraph().getRootNode().computeCumulativeBB(); - resourceManager_->setLightSetup(gfx::getDefaultLights()); + // set the default light key to reference the scene's light setup + auto initSceneInstanceAttr = + metadataMediator_->getSceneInstanceAttributesManager() + ->getObjectCopyByHandle(curSceneInstanceAttributes_->getHandle()); + auto sceneLightSetup = resourceManager_->getLightSetup( + initSceneInstanceAttr->getLightingHandle()); + resourceManager_->setLightSetup(*sceneLightSetup); } // Simulator::reset() metadata::attributes::SceneInstanceAttributes::ptr