-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Crash when calling python Usd.Prim.IsDefined() on a null prim #753
Comments
Thanks, @marktucker ! I'd vote for removing IsDefined from the whitelist, since its behavior relies on the presence of authored scene data, but would like for @gitamohr to weigh in. |
Filed as internal issue #USD-5045. |
Behavior should match between Python and C++. So either python throws an
exception and C++ crashes, or both return false.
…On Tue, Jan 29, 2019 at 12:30 PM jtran56 ***@***.***> wrote:
Filed as internal issue #USD-5045.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#753 (comment)>,
or mute the thread
<https:/notifications/unsubscribe-auth/ABLBEdsKdNWWqGe2xdnKXl76iihvIL3Dks5vIK9MgaJpZM4aR20_>
.
|
francis-wangfr
pushed a commit
to autodesk-forks/USD
that referenced
this issue
Feb 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of Issue
When you have a null prim object in Python, calling almost any method on it throws a python exception. A few methods (like IsValid()) return values. But IsDefined() crashes the applications
Steps to Reproduce
p = usdviewApi.stage.GetPrimAtPath('/not_a_prim')
p.IsDefined()
This is because in usd/wrapObject.cpp, in getattribute, there is a specific test done for a few method names. One of which is "IsDefined". This check allows the IsDefined method to be run even if the primitive is invalid (just as it allows IsValid() to return False instead of raising an exception). Every other Prim method (IsActive for example) raises an exception. The simple solution, I believe, is to just remove IsDefined from this list. But it's possible that this method really should be in this list, in which case I thinkit's implementation in wrapPrim.cpp needs to be changed to explicitly check for the null prim case?
The actual "crash" is caused in Usd_PrimDataHandle::operator->, where it calls UsdIssueFatalPrimAccessError().
The text was updated successfully, but these errors were encountered: