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

Test pixelMove UFE support. #2412

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

ppt-adsk
Copy link
Collaborator

@ppt-adsk ppt-adsk commented Jun 10, 2022

This change tests the new UFE support in the pixelMove command. This addresses
#2234

@@ -298,6 +298,16 @@ def mayaMajorMinorVersions():
"""
return (mayaMajorVersion(), mayaMinorVersion())

def ufeSupportFixLevel():
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Return the newly-implemented UFE fix level, to determine if the UFE pixelMove support is present in Maya or not. fixLevel is implemented in Maya, in the ufeSupport.utils module. If the fixLevel function does not exist, returns 0.


import ufe

@unittest.skipUnless(mayaUtils.ufeSupportFixLevel() > 0, "Requires pixelMove UFE support.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

UFE support for pixelMove is implemented at fix level 1, so don't run if fix level is below that.

cmds.file(new=True, force=True)
cmds.select(clear=True)

def testPixelMove(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test UFE pixelMove support by comparing with a Maya object. Move for Maya object and move for non-Maya object (i.e. USD) must match.

@@ -43,6 +43,7 @@ if(CMAKE_UFE_V2_FEATURES_AVAILABLE)
)

list(APPEND INTERACTIVE_TEST_SCRIPT_FILES
testPixelMoveCmd.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pixelMove requires a view and a camera, so must be an interactive test.

@ppt-adsk ppt-adsk added the unit test Related to unit tests (both python or c++) label Jun 10, 2022
@ppt-adsk
Copy link
Collaborator Author

Only failure is master OSX Python 3 only, with clang compiler crash while compiling mayaShaderTranslation.cpp, appears to be a random failure.

'''Pixel move command must move non-Maya UFE objects.'''

# pixelMove has different behavior for orthographic and perspective
# views. Only perspective views are affected by the selected objects'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also test doing pixel move while looking through an ortho camera?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ortho camera pixel move is unaffected by the selection, and therefore did not require UFE-related changes. Testing pixel move with ortho camera is essentially testing Maya behavior, which plugins should simply rely on and expect (hope?) is tested in Maya.

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jun 14, 2022
@seando-adsk seando-adsk merged commit 8a7febc into dev Jun 17, 2022
@seando-adsk seando-adsk deleted the tremblp/MAYA-122562/test_ufe_pixel_move_cmd branch June 17, 2022 15:51
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