Skip to content

Commit 1c4e0c0

Browse files
camelo918pixar-oss
authored andcommitted
fix niInstanceAggregationSceneIndex to handle paths that are
not namespace descendents when computing binding hash. for a sibling path, walk ancestors to find the nearest native instance root and lazily normalize it value to be relative to the instance root. for model:modelPath in ModelAPI, we follow the deferred skinniing pattern by relocating it to model:modelPath primvar in UsdImagingNiPrototypePropagatingSceneIndex since it can be an arbitrary. ancestor path. They are then aggregated automatically as instance primvar on the instancer. this solves the hash difference as well as allow it to survive instance aggregation, otherwise once aggregated, only the value of the first instance will be available on the prototype. add usdImaging unit test as well as a usdSkelImaging integration test. add USDIMAGING_API export macro to methods used in test so that they compile on windows. (Internal change: 2420089)
1 parent bfcf3fd commit 1c4e0c0

12 files changed

Lines changed: 1047 additions & 27 deletions

pxr/usdImaging/usdImaging/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ pxr_build_test(testUsdImagingRerootingSceneIndex
261261
CPPFILES
262262
testenv/testUsdImagingRerootingSceneIndex.cpp
263263
)
264+
pxr_build_test(testUsdImagingNiAggregationNonDescendantPaths
265+
LIBRARIES
266+
usdImaging
267+
hd
268+
sdf
269+
tf
270+
CPPFILES
271+
testenv/testUsdImagingNiAggregationNonDescendantPaths.cpp
272+
)
264273
pxr_build_test(testUsdImagingRootPrim
265274
LIBRARIES
266275
usdImaging
@@ -376,6 +385,12 @@ pxr_register_test(testUsdImagingRerootingSceneIndex
376385
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingRerootingSceneIndex"
377386
EXPECTED_RETURN_CODE 0
378387
)
388+
pxr_register_test(testUsdImagingNiAggregationNonDescendantPaths
389+
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingNiAggregationNonDescendantPaths"
390+
EXPECTED_RETURN_CODE 0
391+
ENV
392+
USD_ASSIGN_PROTOTYPES_DETERMINISTICALLY=1
393+
)
379394
pxr_register_test(testUsdImagingRootPrim
380395
COMMAND "${CMAKE_INSTALL_PREFIX}/tests/testUsdImagingRootPrim"
381396
EXPECTED_RETURN_CODE 0

pxr/usdImaging/usdImaging/hdSchemaDefs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
('assetName', T_STRING, {}),
7575
('assetVersion', T_STRING, {}),
7676
],
77+
EXTRA_TOKENS = [
78+
'(modelPathPrimvarName, "model:modelPath")',
79+
],
7780
),
7881

7982
#--------------------------------------------------------------------------

pxr/usdImaging/usdImaging/modelSchema.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,16 @@ PXR_NAMESPACE_OPEN_SCOPE
3838
(assetIdentifier) \
3939
(assetName) \
4040
(assetVersion) \
41+
((modelPathPrimvarName, "model:modelPath")) \
4142

4243
TF_DECLARE_PUBLIC_TOKENS(UsdImagingModelSchemaTokens, USDIMAGING_API,
4344
USD_IMAGING_MODEL_SCHEMA_TOKENS);
4445

4546
//-----------------------------------------------------------------------------
4647

4748

49+
/// \class UsdImagingModelSchema
50+
///
4851
class UsdImagingModelSchema : public HdSchema
4952
{
5053
public:

0 commit comments

Comments
 (0)