Skip to content

Commit

Permalink
Updates to usdGeom et al to deprecate UsdAttribute::HasAuthoredValueO…
Browse files Browse the repository at this point in the history
…pinion()

in favor of UsdAttribute::HasAuthoredValue()

For details on why we do this, see change 1923544

(Internal change: 1924169)
  • Loading branch information
spiffmon authored and pixar-oss committed Dec 13, 2018
1 parent 6c3e3db commit b447c35
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pxr/usd/lib/usdGeom/bboxCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ UsdGeomBBoxCache::_ResolvePrim(_BBoxTask* task,
// For more information, see bugzilla #115735

bool primHasAuthoredPoints =
pointBasedObj.GetPointsAttr().HasAuthoredValueOpinion();
pointBasedObj.GetPointsAttr().HasAuthoredValue();

if (primHasAuthoredPoints) {
successGettingExtent = _ComputeExtent(boundableObj, &extent);
Expand Down
2 changes: 1 addition & 1 deletion pxr/usd/lib/usdGeom/motionAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ float UsdGeomMotionAPI::ComputeVelocityScale(UsdTimeCode time) const
while (prim != pseudoRoot){
UsdAttribute vsAttr =
prim.GetAttribute(UsdGeomTokens->motionVelocityScale);
if (vsAttr.HasAuthoredValueOpinion() &&
if (vsAttr.HasAuthoredValue() &&
vsAttr.Get(&velocityScale, time)){
return velocityScale;
}
Expand Down
3 changes: 2 additions & 1 deletion pxr/usd/lib/usdGeom/pointInstancer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ UsdGeomPointInstancer::VisAllIds(UsdTimeCode const &time) const
{
VtInt64Array invised(0);

if (GetInvisibleIdsAttr().HasAuthoredValueOpinion())
if (GetInvisibleIdsAttr().HasAuthoredValue())
// We _could_ just block the attr instead. Better?
return CreateInvisibleIdsAttr().Set(invised, time);

return true;
Expand Down
6 changes: 1 addition & 5 deletions pxr/usd/lib/usdGeom/primvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,7 @@ UsdGeomPrimvar::GetIndices(VtIntArray *indices,
bool
UsdGeomPrimvar::IsIndexed() const
{
UsdResolveInfo valueSource = _GetIndicesAttr(/*create*/ false).
GetResolveInfo(UsdTimeCode::EarliestTime());

return (valueSource.HasAuthoredValueOpinion() &&
!valueSource.ValueIsBlocked());
return _GetIndicesAttr(/*create*/ false).HasAuthoredValue();
}

bool
Expand Down
12 changes: 6 additions & 6 deletions pxr/usd/lib/usdGeom/testenv/testUsdGeomSchemata.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def test_Fallbacks(self):

xform = UsdGeom.Xform.Define(stage, "/Xform") # direct subclass
xformOpOrder = xform.GetXformOpOrderAttr()
self.assertFalse(xformOpOrder.HasAuthoredValueOpinion())
self.assertFalse(xformOpOrder.HasAuthoredValue())
# xformOpOrder has no fallback value
self.assertEqual(xformOpOrder.Get(), None)
self.assertFalse(xformOpOrder.HasFallbackValue())
Expand All @@ -252,11 +252,11 @@ def test_Fallbacks(self):

opOrderVal = ["xformOp:transform"]
self.assertTrue(xformOpOrderAttr.Set(opOrderVal))
self.assertTrue(xformOpOrderAttr.HasAuthoredValueOpinion())
self.assertTrue(xformOpOrderAttr.HasAuthoredValue())

self.assertNotEqual(xformOpOrderAttr.Get(), None)
self.assertTrue(xformOpOrderAttr.Clear())
self.assertFalse(xformOpOrderAttr.HasAuthoredValueOpinion())
self.assertFalse(xformOpOrderAttr.HasAuthoredValue())
self.assertEqual(xformOpOrderAttr.Get(), None)
self.assertFalse(xformOpOrder.HasFallbackValue())

Expand All @@ -271,14 +271,14 @@ def test_Fallbacks(self):
# scenarios
# Number 1: Sparse and non-sparse authoring on def'd prim
mesh.CreateDoubleSidedAttr(False, True)
self.assertFalse(mesh.GetDoubleSidedAttr().HasAuthoredValueOpinion())
self.assertFalse(mesh.GetDoubleSidedAttr().HasAuthoredValue())
mesh.CreateDoubleSidedAttr(False, False)
self.assertTrue(mesh.GetDoubleSidedAttr().HasAuthoredValueOpinion())
self.assertTrue(mesh.GetDoubleSidedAttr().HasAuthoredValue())

# Number 2: Sparse authoring demotes to dense for non-defed prim
overMesh = UsdGeom.Mesh(stage.OverridePrim('/overMesh'))
overMesh.CreateDoubleSidedAttr(False, True)
self.assertTrue(overMesh.GetDoubleSidedAttr().HasAuthoredValueOpinion())
self.assertTrue(overMesh.GetDoubleSidedAttr().HasAuthoredValue())
self.assertEqual(overMesh.GetDoubleSidedAttr().Get(), False)
overMesh.CreateDoubleSidedAttr(True, True)
self.assertEqual(overMesh.GetDoubleSidedAttr().Get(), True)
Expand Down
2 changes: 1 addition & 1 deletion pxr/usd/lib/usdGeom/xformable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ UsdGeomXformable::_GetXformOpOrderValue(
return false;

if (hasAuthoredValue)
*hasAuthoredValue = xformOpOrderAttr.HasAuthoredValueOpinion();
*hasAuthoredValue = xformOpOrderAttr.HasAuthoredValue();

xformOpOrderAttr.Get(xformOpOrder, UsdTimeCode::Default());
return true;
Expand Down

0 comments on commit b447c35

Please sign in to comment.