-
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 for UFE v1 code path with missing "|world". #1050
Conversation
// with "|world" and will pop it off. So make sure our string has it. | ||
// Note: std::string starts_with only added for C++20. So use diff trick. | ||
std::string proxyPath; | ||
if (ufePathString.rfind("|world", 0) == std::string::npos) { |
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.
Nice trick.
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 regression test and cover all ways we can access the stage (with and without ufe)
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.
Great test, thanks for doing this!
@mattyjams I added to you review the change I made to test/lib/ufe/testUfePythonImport.py |
#ifdef UFE_V2_FEATURES_AVAILABLE | ||
def("getPrimFromRawItem", getPrimFromRawItem); | ||
def("getNodeNameFromRawItem", getNodeNameFromRawItem); | ||
#endif | ||
|
||
def("getNodeTypeFromRawItem", getNodeTypeFromRawItem); | ||
#endif |
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.
The raw item (for ufe scene item) was only added in UFE v2. So these three wrappers that use raw item should only be avail in v2.
''' Called initially to set up the Maya test environment ''' | ||
self.assertTrue(self.pluginsLoaded) | ||
|
||
def testWrappers(self): |
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.
New test where I test all the maya-usd ufe wrapper methods.
test/lib/ufe/testUfePythonImport.py
Outdated
if ufe.VersionInfo.getMajorVersion() >= 2: | ||
# raw item only introduced in UFE v2 | ||
invalidPrim = mayaUsdUfe.getPrimFromRawItem(0) | ||
else: | ||
# In UFE v2 if the Nb segments == 1, returns invalid prim | ||
invalidPrim = mayaUsdUfe.ufePathToPrim('a') |
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.
This test is avail in UFE v1, but it was using a ufe wrapper method that I've made only avail in UFE v2. So for the v1 case use a different wrapper method. We cannot just use ufePathToPrim for both UFE versions, since in UFE v2 ufePathToPrim uses different code that will assert with an invalid input path.
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.
Excellent test, thank you!
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 to me!
@@ -23,6 +23,7 @@ | |||
import mayaUsd.ufe | |||
|
|||
import ufe | |||
import ufeUtils |
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.
Oops I forgot to include this to have access for line 45. Since this usd utils already includes ufe, including the ufeUtils should be okay.
No description provided.