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

move import of ufeSelectCmd inside selectPath() function in ufeUtils #1237

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions test/testUtils/ufeUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
"""

import ufe
try:
from maya.internal.ufeSupport import ufeSelectCmd
except ImportError:
# Maya 2019 and 2020 don't have ufeSupport plugin, so use fallback.
from ufeScripts import ufeSelectCmd


def getUfeGlobalSelectionList():
"""
Expand All @@ -46,6 +42,15 @@ def selectPath(path, replace=False):
replace (bool=False): Replace the selection with
given UFE path
"""
# Do this import inside this function rather than at the top of the file
# so that the module can be imported and ufeFeatureSetVersion() can be
# called prior to maya.standalone.initialize().
try:
from maya.internal.ufeSupport import ufeSelectCmd
except ImportError:
# Maya 2019 and 2020 don't have ufeSupport plugin, so use fallback.
from ufeScripts import ufeSelectCmd

sceneItem = ufe.Hierarchy.createItem(path)
if replace:
selection = ufe.Selection()
Expand Down