-
Notifications
You must be signed in to change notification settings - Fork 79
Fix corrupted scene primMap with invalid prim (USDU-60, #158) #220
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
Merged
judubu
merged 4 commits into
dev
from
fix_corrupted_scene_primmap_with_invalid_prim_usdu-60
Nov 16, 2020
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4b6cbd7
Fix the scene primMap that was corrupted with invalid prim (USDU-60)
lucillecaillaud 7228968
Update CHANGELOG (USDU-60)
lucillecaillaud 5a4ff3b
Add tests to USD.NET tests (USDU-60)
judubu b2c6676
Remove test from unit tests (USDU-60)
judubu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the prim isn't valid (after calling GetPrimAtPath) and the path does exist in the map, should the path be cleared here to keep the primMap accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question... I don't know ^^. What would be the case where it happens?... If a prim is removed on disk maybe?? Then, when refreshing... the primMap wouldn't be accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's what I was thinking -- like a file is regenerated and some prims are removed, or some flavor of that.
I don't think this is a /bug/ but I think it would be a good axiom to enforce that the prim map is always either pointing to a valid prim or has no entry.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(It should be super easy to test this with an ascii file, just delete the prim and see what happens on reload at that point, but as I read the code, it looks like an entry will be left in the prim map)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcowles What is the benefit of the primMap here? Stage.GetPrimAtPath is a sdf operation and will be cached anyway so it should be fast.
If we keep a local cache in Scene I can't see a reliable way to ensure the cache stays in sync while we expose the stage as public. We could provide our own Scene.RemovePrim and Scene.Reload but nothing prevents the users to call scene.Stage.RemovePrim or scene.Stage.Reload ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the original motivation was to avoid the C++/C# roundtrip just to get a prim, though it seems silly now.
I wonder if we can just kill it entirely -- given that this requires grabbing a lock, seems like that would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a ticket for this one: https://jira.unity3d.com/browse/USDU-135