Skip to content

Commit

Permalink
Merge pull request #1798 from robpieke/CameraAdapterAllAttributes
Browse files Browse the repository at this point in the history
Consider *all* attributes for `UsdImagingCameraAdapter::TrackVariability`

(Internal change: 2229905)
  • Loading branch information
pixar-oss committed May 9, 2022
2 parents e735e29 + 8f82263 commit 7ae71f8
Showing 1 changed file with 18 additions and 109 deletions.
127 changes: 18 additions & 109 deletions pxr/usdImaging/usdImaging/cameraAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,115 +121,24 @@ UsdImagingCameraAdapter::TrackVariability(UsdPrim const& prim,
timeVaryingBits,
false);

// Rest of the function is just checking whether any
// param is time-varying.

if (_IsVarying(prim,
UsdGeomTokens->projection,
HdCamera::DirtyParams,
HdCameraTokens->projection,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->horizontalAperture,
HdCamera::DirtyParams,
HdCameraTokens->horizontalAperture,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->verticalAperture,
HdCamera::DirtyParams,
HdCameraTokens->verticalAperture,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->horizontalApertureOffset,
HdCamera::DirtyParams,
HdCameraTokens->horizontalApertureOffset,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->verticalApertureOffset,
HdCamera::DirtyParams,
HdCameraTokens->verticalApertureOffset,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->focalLength,
HdCamera::DirtyParams,
HdCameraTokens->focalLength,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->clippingRange,
HdCamera::DirtyParams,
HdCameraTokens->clippingRange,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->fStop,
HdCamera::DirtyParams,
HdCameraTokens->fStop,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->focusDistance,
HdCamera::DirtyParams,
HdCameraTokens->focusDistance,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->shutterOpen,
HdCamera::DirtyParams,
HdCameraTokens->shutterOpen,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->shutterClose,
HdCamera::DirtyParams,
HdCameraTokens->shutterClose,
timeVaryingBits,
false)) {
return;
}

if (_IsVarying(prim,
UsdGeomTokens->exposure,
HdCamera::DirtyParams,
HdCameraTokens->exposure,
timeVaryingBits,
false)) {
return;
// If any other camera attributes are time varying
// we will assume all camera params are time-varying.
const std::vector<UsdAttribute> &attrs = prim.GetAttributes();
for (UsdAttribute const& attr : attrs) {
// Don't double-count clipping-plane or transform attrs.
if (attr.GetBaseName() == UsdGeomTokens->clippingPlanes) { continue; }
if (UsdGeomXformable::IsTransformationAffectedByAttrNamed(
attr.GetBaseName())) {
continue;
}
if (_IsVarying(prim,
attr.GetName(),
HdCamera::DirtyParams,
attr.GetName(),
timeVaryingBits,
false)) {
return;
}
}
}

Expand Down

0 comments on commit 7ae71f8

Please sign in to comment.