void UsdImagingCubeAdapter::UpdateForTime(UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time, HdDirtyBits requestedBits, HdDirtyBits* resultBits, UsdImagingInstancerContext const* instancerContext) { BaseAdapter::UpdateForTime( prim, cachePath, time, requestedBits, resultBits, instancerContext); UsdImagingValueCache* valueCache = _GetValueCache(); if (requestedBits & HdChangeTracker::DirtyTransform) { // Update the transform with the size authored for the cube. GfMatrix4d& ctm = valueCache->GetTransform(cachePath); GfMatrix4d xf = GetMeshTransform(prim, time); ctm = xf * ctm; } if (requestedBits & HdChangeTracker::DirtyTopology) { valueCache->GetTopology(cachePath) = GetMeshTopology(); } if (requestedBits & HdChangeTracker::DirtyPoints) { valueCache->GetPoints(cachePath)= GetMeshPoints(prim, time); // Expose points as a primvar. UsdImagingValueCache::PrimvarInfo primvar; primvar.name = HdTokens->points; primvar.interpolation = UsdGeomTokens->vertex; PrimvarInfoVector& primvars = valueCache->GetPrimvars(cachePath); _MergePrimvar(primvar, &primvars); } }
// Thread safe. // * Populate dirty bits for the given \p time. void UsdImagingConeAdapter::UpdateForTime(UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time, int requestedBits, int* resultBits, UsdImagingInstancerContext const* instancerContext) { BaseAdapter::UpdateForTime( prim, cachePath, time, requestedBits, resultBits, instancerContext); UsdImagingValueCache* valueCache = _GetValueCache(); if (requestedBits & HdChangeTracker::DirtyTopology) { valueCache->GetTopology(cachePath) = GetMeshTopology(); } if (requestedBits & HdChangeTracker::DirtyPoints) { valueCache->GetPoints(cachePath) = GetMeshPoints(prim, time); // Expose points as a primvar. UsdImagingValueCache::PrimvarInfo primvar; primvar.name = HdTokens->points; primvar.interpolation = UsdGeomTokens->vertex; _MergePrimvar(primvar, &valueCache->GetPrimvars(cachePath)); } }
/*virtual*/ VtValue UsdImagingCubeAdapter::GetPoints(UsdPrim const& prim, SdfPath const& cachePath, UsdTimeCode time) const { TF_UNUSED(cachePath); return GetMeshPoints(prim, time); }