Skip to content
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

Conversation

JGamache-autodesk
Copy link
Collaborator

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.

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.
@JGamache-autodesk
Copy link
Collaborator Author

Reviewed by Wayne Arnold (2023-05-25 15:16):

yes, it looks ok.

@JGamache-autodesk
Copy link
Collaborator Author

Preflight failed due to pipeline flakiness. Should be considered OK. Will retry to see if pipeline issue should be investigated.

Copy link
Collaborator

@seando-adsk seando-adsk left a 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.

@JGamache-autodesk
Copy link
Collaborator Author

Results in the following paths in the final MAYA_SCRIPT_PATH and in the secure locations:

${USD_INSTALL_LOCATION}/lib/python
${MAYAUSD_INSTALL_LOCATION}/lib/scripts
${MAYAUSD_INSTALL_LOCATION}/lib/python
${MAYAUSD_INSTALL_LOCATION}/plugin/al/scripts
${MAYAUSD_INSTALL_LOCATION}/plugin/al/lib/python
${MAYAUSD_INSTALL_LOCATION}/plugin/adsk/scripts
${MAYAUSD_INSTALL_LOCATION}/plugin/pxr/maya/lib/usd/usdMaya/resources
${MAYAUSD_INSTALL_LOCATION}/plugin/pxr/lib/python

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label May 29, 2023
seando-adsk
seando-adsk previously approved these changes May 29, 2023
@seando-adsk seando-adsk added adsk Related to Autodesk plugin al Related to AnimalLogic plugin pxr Related to Pixar plugin labels May 29, 2023

node = cmds.createNode("script")

# This Pixar import will fail and stop the script unless it was added to the secure import paths.
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@seando-adsk seando-adsk merged commit ee64371 into dev May 30, 2023
@seando-adsk seando-adsk deleted the gamaj/LOOKDEVX-1429/mark_mayausd_python_bindings_as_safe_for_scrips branch May 30, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin al Related to AnimalLogic plugin pxr Related to Pixar plugin ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants