Skip to content

Commit

Permalink
Merge pull request #2317 from mattyjams/pr/align_python_property_stac…
Browse files Browse the repository at this point in the history
…k_getter_signatures_with_cpp

usd: align Python UsdProperty property stack getter API with C++

(Internal change: 2265952)
  • Loading branch information
pixar-oss committed Mar 14, 2023
2 parents 85ace6e + 4efd416 commit 17f01ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions pxr/usd/usd/testenv/testUsdCreateProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,11 @@ def test_GetPropertyStack(self):
(expectedPropertyStack[2], Sdf.LayerOffset(20.0, 2.0))
]

# ensure that fetching property stacks with and without providing
# the default timecode as an argument yields the same result.
self.assertEqual(attr.GetPropertyStack(), expectedPropertyStack)
self.assertEqual(attr.GetPropertyStackWithLayerOffsets(),
expectedPropertyStackWithLayerOffsets)
self.assertEqual(attr.GetPropertyStack(Usd.TimeCode.Default()),
expectedPropertyStack)
self.assertEqual(attr.GetPropertyStackWithLayerOffsets(
Expand Down
4 changes: 2 additions & 2 deletions pxr/usd/usd/wrapProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ void wrapUsdProperty()
arg("nestedGroups"))

.def("GetPropertyStack", &UsdProperty::GetPropertyStack,
arg("time"))
arg("time")=UsdTimeCode::Default())
.def("GetPropertyStackWithLayerOffsets",
&UsdProperty::GetPropertyStackWithLayerOffsets,
arg("time"),
arg("time")=UsdTimeCode::Default(),
return_value_policy<TfPySequenceToList>())

.def("IsCustom", &UsdProperty::IsCustom)
Expand Down

0 comments on commit 17f01ef

Please sign in to comment.