Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider *all* attributes for UsdImagingCameraAdapter::TrackVariability #1798

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
robpieke marked this conversation as resolved.
Show resolved Hide resolved
if (_IsVarying(prim,
attr.GetName(),
HdCamera::DirtyParams,
attr.GetName(),
timeVaryingBits,
false)) {
return;
}
}
}

Expand Down