Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix an issue with the MergingSceneIndex. #3263

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

marktucker
Copy link
Contributor

Description of Change(s)

When triggering a "whole scene" removal, this scene index can cause the whole scene to be "added", and nothing to be "removed", which is a problem. This can be triggered by the removeal of a sublayer from the stage. This way of handling the change causes accesses to expired UsdPrims, which throw exceptions.

This commit attempts to be more precise about the add and remove changes sent in this situation by "adding" prims that are still in any merged scene index, and "removing" any prims that exist only in the scene index that triggered the change. This can result in a lot of small changes instead of one big change, so there may be a need to optimize this, but I think the principle is correct (and the commit does prevent the invlid UsdPrim access exceptions).

I'm not at all sure that this is the right fix here, but it was enough to get me over the bump I hit with using USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX=1 in Houdini (which does a lot of sublayer removal and adding on a hydra-watched stage). So this is really more meant as a starting point rather than something I expect to be merged as is.

Fixes Issue(s)

  • 3261

  • [ X ] I have verified that all unit tests pass with the proposed changes

  • [ X ] I have submitted a signed Contributor License Agreement

When triggering a "whole scene" removal, this scene index can cause the
whole scene to be "added", and nothing to be "removed", which is a
problem. This can be triggered by the removeal of a sublayer from the
stage. This way of handling the change causes accesses to expired
UsdPrims, which throw exceptions.

This commit attempts to be more precise about the add and remove changes
sent in this situation by "adding" prims that are still in any merged scene
index, and "removing" any prims that exist only in the scene index that
triggered the change. This can result in a _lot_ of small changes instead
of one big change, so there may be a need to optimize this, but I think the
principle is correct (and the commit does prevent the invlid UsdPrim access
exceptions).
@jesschimein
Copy link

Filed as internal issue #USD-10054

@jesschimein
Copy link

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants