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

MAYA-112854 - Fix warnings from USDZ texture import #1589

Merged
merged 2 commits into from
Jul 28, 2021

Conversation

JGamache-autodesk
Copy link
Collaborator

  • Do not check folders if not importing USDZ textures
  • Create sourceImages if no path was given, and there is an active project, and the sourceImage folder is not yet created in that project.

Fixes #1588

- Do not check folders if not importing USDZ textures
- Create sourceImages if no path was given, and there is an active project, and the sourceImage folder is not yet created in that project.
Copy link

@kxl-adsk kxl-adsk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, Jerry. Do you mind adding a regression test?

@@ -65,6 +66,10 @@ def __testUsdPreviewSurfaceRoundtrip(self,
"""
Tests that a usdPreviewSurface exports and imports correctly.
"""
mark = Tf.Error.Mark()
mark.SetMark()
self.assertTrue(mark.IsClean())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This unit test used to report the "sourceImage" error 10 times. Adding TfMarks makes sure the unit test runs clean and proves the issue is fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(would be a good idea to generalize the use of these marks to make sure we never ignore a USD error)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find! And agreed!

image_path = os.path.join(project_path, cmds.workspace(fre="sourceImages"))
# Purposefully erase the sourceimage directory:
if os.path.isdir(image_path):
shutil.rmtree(image_path)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically testing import into a missing sourceImages folder:

@JGamache-autodesk JGamache-autodesk added the ready-for-merge Development process is finished, PR is ready for merge label Jul 21, 2021
@JGamache-autodesk
Copy link
Collaborator Author

Got the expected license failure on OS/X. So ready for merge.

@kxl-adsk kxl-adsk merged commit 4c6ab70 into dev Jul 28, 2021
@kxl-adsk kxl-adsk deleted the t_gamaj/MAYA-112854/fix_usdz_path_warnings branch July 28, 2021 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
import-export Related to Import and/or Export 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.

[MAYA-112854] mayaUSDImport throws USDZ related error when importing other file types
3 participants