-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fix naming a prim to something that contains an invalid character crashes Maya #628
Fix naming a prim to something that contains an invalid character crashes Maya #628
Conversation
…character crashes Maya
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.
Please add a regression test for illegal characters rename.
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.
Looks good, as per Krystian's comment needs a test.
test/lib/ufe/testRename.py
Outdated
snIter = iter(ufe.GlobalSelection.get()) | ||
pSphereItem = next(snIter) |
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.
Since rename is UFE v2 only, you can just use Ufe::Selection::front():
pSphereItem = ufe.GlobalSelection.get().front()
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.
test/lib/ufe/testRename.py
Outdated
pSphereItemRenamed = str(pSphereItem.path().back()) | ||
|
||
# get the prim | ||
usdPrim = stage.GetPrimAtPath('/sphereXform/' + pSphereItemRenamed) |
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 would be just
usdPrim = stage.GetPrimAtPath(str(pSphereItem.path().segments[1]))
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.
please see a036874
test/lib/ufe/testRename.py
Outdated
# rename | ||
try: | ||
primspec.name = pSphereItemRenamed | ||
except: | ||
print(sys.exc_info()[1]) |
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.
Not quite sure what this is testing in maya-usd. You are just testing USD primSpec renaming here, essentially, which should be tested in USD.
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.
@ppt-adsk I agree. this looks weird indeed. :)
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.
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.
Thanks for the change, much more relevant.
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.
Thank you for adding the test.
No description provided.