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

Initial cache to USD test. #2081

Merged
merged 1 commit into from
Feb 10, 2022
Merged

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Feb 9, 2022

Cache to USD unit test. Only testing sibling prim with payload for now. No discard edits test yet.

@@ -9,6 +9,13 @@ list(APPEND scripts_src
mayaUsdMayaReferenceUtils.py
)

list(APPEND maya_lib_scripts_src
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

USD cache creation options moved out of UI code to separate Python module, under mayaUsd.lib

# Animation is always on for cache to USD.
return turnOnAnimation(cmds.translator('USD Export', query=True, do=True))

def getCacheCreationOptions(exportOptions, cacheFile, cachePrimName,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Utilities to centralize cache option creation in Python.

variantName = None
variantSetName = None

userArgs = cacheToUsd.getCacheCreationOptions(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Use new utility functions.

@@ -58,19 +57,6 @@ def setUp(self):
self.proxyShapePathStr = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
self.stage = mayaUsd.lib.GetPrim(self.proxyShapePathStr).GetStage()

@staticmethod
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Factored out to mayaUtils.py for re-use.

@@ -239,6 +239,23 @@ def createProxyFromFile(filePath):

return shapeNode,shapeStage

def createSingleSphereMayaScene(directory=None):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved here and adapted from testAddMayaReference.py

fixturesUtils.readOnlySetUpClass(__file__, loadPlugin=False)
if not cls.pluginsLoaded:
cls.pluginsLoaded = mayaUtils.isMayaUsdPluginLoaded()
fixturesUtils.setUpClass(__file__)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need to create a Maya file in a temporary directory, using the fixture utils sets up a temporary directory for the test, and clears it out before running. Just use setUpClass() instead of readOnlySetUpClass(). Also (have seen this in a few places) why pass in loadPlugin=False to the fixturesUtils, then load the plugin separately? Just use the fixturesUtils service.

@@ -67,6 +67,18 @@ def createUfeSceneItem(dagPath, sdfPath=None):
ufeItem = ufe.Hierarchy.createItem(ufePath)
return ufeItem

def createItem(ufePathOrPathString):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Utilities to simplify UFE scene item and hierarchy interface creation. Should have done this a while ago... Should be deployed to other tests as we maintain them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Given that I never remember the incantations, it will help me!

@ppt-adsk
Copy link
Collaborator Author

Build failure is on a single configuration, which simply did not start:
Error: remote build /job/https://ecg-jenkins.ecs.ads.autodesk.com/job/ecg-mayausd-branch-preflight-python3-osx/1647 failed to launch
All other configurations passed. Therefore, I believe the pull request is ready to merge.

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Feb 10, 2022
@seando-adsk seando-adsk added the unit test Related to unit tests (both python or c++) label Feb 10, 2022
@seando-adsk seando-adsk merged commit f37eaa1 into dev Feb 10, 2022
@seando-adsk seando-adsk deleted the tremblp/MAYA-121572/test_cache_to_usd_00 branch February 10, 2022 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants