Skip to content

Commit

Permalink
Mark camera prims as varying if any attributes on the camera have time
Browse files Browse the repository at this point in the history
samples. This matches the behavior of the light adapter, and handles extra
attributes added through API schemas applied to the camera.
  • Loading branch information
marktucker committed Feb 24, 2022
1 parent 95f731c commit cf645e9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pxr/usdImaging/usdImaging/cameraAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,25 @@ UsdImagingCameraAdapter::TrackVariability(UsdPrim const& prim,
false);
}
}

if ((*timeVaryingBits & HdCamera::DirtyParams) != 0)
return;

// The block of code below was copied from `lightAdapter.cpp`
// If any of the camera attributes is 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 transform attrs.
if (UsdGeomXformable::IsTransformationAffectedByAttrNamed(
attr.GetBaseName())) {
continue;
}
if (attr.GetNumTimeSamples()>1){
*timeVaryingBits |= HdCamera::DirtyParams;
break;
}
}
}

void
Expand Down

0 comments on commit cf645e9

Please sign in to comment.