-
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
LOOKDEVX-1429 - Mark USD and MayaUSD Python bindings as safe #3119
LOOKDEVX-1429 - Mark USD and MayaUSD Python bindings as safe #3119
Conversation
This allows importing USD and MayaUSD modules in script nodes. Either directly, or from surprisingly deep in the C++ callstack as USD can call Python to read shader definitions via code found in the pxr.SdrGlslfx module.
Reviewed by Wayne Arnold (2023-05-25 15:16):
|
Preflight failed due to pipeline flakiness. Should be considered OK. Will retry to see if pipeline issue should be investigated. |
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.
As discussed internally the scripts:
line with two paths doesn't behave like you think and parse into two full paths.
Results in the following paths in the final MAYA_SCRIPT_PATH and in the secure locations:
|
|
||
node = cmds.createNode("script") | ||
|
||
# This Pixar import will fail and stop the script unless it was added to the secure import paths. |
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 unit tests do not use the .mod files. All the variables are setup in the ctest.cmake file. I think you need to modify that for the tests.
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.
Indeed, this is why I set MAYA_MODULE_PATH for the testMayaUsdPythonImport unit test here. This is also where MAYA_SECURE_BATCH_ENABLE is added to stop the script from running if an unsecure module import is detected.
This allows importing USD and MayaUSD modules in script nodes. Either directly, or from surprisingly deep in the C++ callstack as USD can call Python to read shader definitions via code found in the pxr.SdrGlslfx module.