diff --git a/lib/hydramoonray/Light.cc b/lib/hydramoonray/Light.cc index 65409e4..0cea912 100644 --- a/lib/hydramoonray/Light.cc +++ b/lib/hydramoonray/Light.cc @@ -404,8 +404,12 @@ Light::Sync(pxr::HdSceneDelegate *sceneDelegate, // Value is either "" or ".collection:lightLink" though this will allow others. // Currently Finalize() is called when value changes, but this may be a bug. bool categoriesChanged = false; - pxr::TfToken t = - sceneDelegate->GetLightParamValue(id, pxr::HdTokens->lightLink).Get(); + pxr::VtValue value = + sceneDelegate->GetLightParamValue(id, pxr::HdTokens->lightLink); + pxr::TfToken t; + if (value.IsHolding()) { + t = value.UncheckedGet(); + } // registering the category id token with RenderDelegate will enable geometry // to look up mLight as the rdl2 scene object corresponding to this category id if (initialize || t != mLightLinkCategory) { @@ -417,7 +421,12 @@ Light::Sync(pxr::HdSceneDelegate *sceneDelegate, categoriesChanged = true; } // "shadowLink" is much the same - t = sceneDelegate->GetLightParamValue(id, pxr::HdTokens->shadowLink).Get(); + value = sceneDelegate->GetLightParamValue(id, pxr::HdTokens->shadowLink); + if (value.IsHolding()) { + t = value.UncheckedGet(); + } else { + t = pxr::TfToken(); + } if (initialize || t != mShadowLinkCategory) { if (!initialize) { renderDelegate.releaseCategory(mLight, RenderDelegate::CategoryType::ShadowLink, mShadowLinkCategory);