diff options
Diffstat (limited to 'intern/cycles/hydra/camera.cpp')
-rw-r--r-- | intern/cycles/hydra/camera.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/intern/cycles/hydra/camera.cpp b/intern/cycles/hydra/camera.cpp index 05f1c32d3c4..5d961a6a090 100644 --- a/intern/cycles/hydra/camera.cpp +++ b/intern/cycles/hydra/camera.cpp @@ -13,6 +13,15 @@ HDCYCLES_NAMESPACE_OPEN_SCOPE extern Transform convert_transform(const GfMatrix4d &matrix); +#if PXR_VERSION < 2102 +// clang-format off +TF_DEFINE_PRIVATE_TOKENS(_tokens, + (projection) + (orthographic) +); +// clang-format on +#endif + HdCyclesCamera::HdCyclesCamera(const SdfPath &sprimId) : HdCamera(sprimId) { #if PXR_VERSION >= 2102 @@ -73,6 +82,7 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, } #endif +#if PXR_VERSION < 2111 if (*dirtyBits & DirtyBits::DirtyProjMatrix) { value = sceneDelegate->GetCameraParamValue(id, HdCameraTokens->projectionMatrix); if (!value.IsEmpty()) { @@ -113,6 +123,7 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, #endif } } +#endif if (*dirtyBits & DirtyBits::DirtyWindowPolicy) { value = sceneDelegate->GetCameraParamValue(id, HdCameraTokens->windowPolicy); @@ -137,9 +148,9 @@ void HdCyclesCamera::Sync(HdSceneDelegate *sceneDelegate, GfCamera::Orthographic); } #else - value = sceneDelegate->GetCameraParamValue(id, UsdGeomTokens->projection); + value = sceneDelegate->GetCameraParamValue(id, _tokens->projection); if (!value.IsEmpty()) { - _data.SetProjection(value.Get<TfToken>() != UsdGeomTokens->orthographic ? + _data.SetProjection(value.Get<TfToken>() != _tokens->orthographic ? GfCamera::Perspective : GfCamera::Orthographic); } |