Skip to content

Commit deffb36

Browse files
committed
HYDRA-2095 : PRMan lighting was broken with maya lights
1 parent 60b596d commit deffb36

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/mayaHydra/hydraExtensions/sceneIndex/mayaHydraSceneIndex.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,16 @@ VtValue MayaHydraSceneIndex::GetMaterialResource(const SdfPath& id)
581581
id,
582582
[](MayaHydraMaterialAdapter* a) -> VtValue { return a->GetMaterialResource(); },
583583
_materialAdapters);
584+
585+
// For PRMan lights, the material network is stored in the light adapter
586+
if (ret.IsEmpty()) {
587+
ret = _GetValue<MayaHydraLightAdapter, VtValue>(
588+
id,
589+
[](MayaHydraLightAdapter* a) -> VtValue { return a->GetLightMaterialNetwork(); },
590+
_lightAdapters
591+
);
592+
}
593+
584594
return ret.IsEmpty() ? MayaHydraMaterialAdapter::GetPreviewMaterialResource(id) : ret;
585595
}
586596

0 commit comments

Comments
 (0)