Skip to content

Commit

Permalink
Add back TempChangeTracking so that fabric prims get deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jul 12, 2023
1 parent 6695270 commit e43b512
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/core/src/FabricUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,20 @@ void destroyPrim(const omni::fabric::Path& path) {

auto srw = UsdUtil::getFabricStageReaderWriter();
srw.destroyPrim(path);

// Prims removed from Fabric need special handling for their removal to be reflected in the Hydra render index
// This workaround may not be needed in future Kit versions, but is needed as of Kit 105.0
const omni::fabric::Path changeTrackingPath("/TempChangeTracking");

if (srw.getAttribute<uint64_t>(changeTrackingPath, FabricTokens::_deletedPrims) == nullptr) {
return;
}

const auto deletedPrimsSize = srw.getArrayAttributeSize(changeTrackingPath, FabricTokens::_deletedPrims);
srw.setArrayAttributeSize(changeTrackingPath, FabricTokens::_deletedPrims, deletedPrimsSize + 1);
auto deletedPrimsFabric = srw.getArrayAttributeWr<uint64_t>(changeTrackingPath, FabricTokens::_deletedPrims);

deletedPrimsFabric[deletedPrimsSize] = omni::fabric::PathC(path).path;
}

void setTilesetTransform(int64_t tilesetId, const glm::dmat4& ecefToUsdTransform) {
Expand Down

0 comments on commit e43b512

Please sign in to comment.