Skip to content

Commit 8843f3b

Browse files
blevinpixar-oss
authored andcommitted
[usdImaging] UsdImagingPiPrototypePropagatingSceneIndex now uses
a hash of the string representation of SdfPath, rather than of the memory address of the internal SdfPath node, when generating names for instancers, in order to provide stable results run-to-run. (Internal change: 2386278)
1 parent fbee383 commit 8843f3b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pxr/usdImaging/usdImaging/piPrototypePropagatingSceneIndex.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,13 @@ _InstancerObserver::_InstancerHash(const SdfPath &instancer) const
404404
// re-rooted path of this prototype contains the instancer hash, so we
405405
// actually compute a chain of hashes if we have nested point instancers.
406406
//
407-
408-
const size_t h = TfHash::Combine(instancer, _propagatedPrototype);
407+
// We use a hash of the path string representation, rather than the
408+
// SdfPath instance, in order to provide a stable result run-to-run.
409+
// Note that SdfPath's hash method uses the memory address of the
410+
// heap allocated path node, which will vary.
411+
const size_t h = TfHash::Combine(
412+
instancer.GetString(),
413+
_propagatedPrototype.GetString());
409414

410415
return TfToken(TfStringPrintf("ForInstancer%zx", h));
411416
}

0 commit comments

Comments
 (0)