Skip to content

Commit

Permalink
fix build failure with VtArray::AsConst() missing for core USD prior …
Browse files Browse the repository at this point in the history
…to 21.02
  • Loading branch information
mattyjams committed Mar 12, 2021
1 parent e4d1e20 commit bf4cbb2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/mayaUsd/ufe/UsdPointInstanceModifierBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,13 @@ class MAYAUSD_CORE_PUBLIC UsdPointInstanceModifierBase
return usdValue;
}

// Avoid triggering a copy-on-write by making sure that we invoke
// operator[] on a const reference to the array.
// For USD 21.02+, avoid triggering a copy-on-write by making sure that
// we invoke operator[] on a const reference to the array.
#if PXR_VERSION >= 2102
return usdValues.AsConst()[instanceIndex];
#else
return usdValues[instanceIndex];
#endif
}

bool setValue(
Expand Down

0 comments on commit bf4cbb2

Please sign in to comment.