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 is no longer using a Preview Release number #63

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 0 additions & 10 deletions cmake/modules/FindMaya.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# MAYA_API_VERSION Maya version (6-8 digits)
# MAYA_APP_VERSION Maya app version (4 digits)
# MAYA_LIGHTAPI_VERSION Maya light API version (1 or 2 or 3)
# MAYA_PREVIEW_RELEASE_VERSION Preview Release number (3 or more digits) in preview releases, 0 in official releases
#
# Cache variables:
# MAYA_HAS_DEFAULT_MATERIAL_API Presence of a default material API on MRenderItem.
Expand Down Expand Up @@ -259,15 +258,6 @@ if(MAYA_INCLUDE_DIRS AND EXISTS "${MAYA_INCLUDE_DIR}/maya/MTypes.h")
endif()
endif()

if(MAYA_INCLUDE_DIRS AND EXISTS "${MAYA_INCLUDE_DIR}/maya/MDefines.h")
file(STRINGS ${MAYA_INCLUDE_DIR}/maya/MDefines.h MAYA_PREVIEW_RELEASE_VERSION REGEX "#define MAYA_PREVIEW_RELEASE_VERSION.*$")
if(MAYA_PREVIEW_RELEASE_VERSION)
string(REGEX MATCHALL "[0-9]+" MAYA_PREVIEW_RELEASE_VERSION ${MAYA_PREVIEW_RELEASE_VERSION})
else()
set(MAYA_PREVIEW_RELEASE_VERSION 0)
endif()
endif()

# Find mayapy
set(MAYAPY_EXE mayapy)
set(MAYA_PY_VERSION 3)
Expand Down
32 changes: 0 additions & 32 deletions test/testUtils/mayaUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@
import ufeUtils, testUtils

import os
import re
import sys

mayaSeparator = "|"

prRe = re.compile('Preview Release ([0-9]+)')

def loadPlugin(pluginName):
"""
Load all given plugins created or needed by maya-ufe-plugin
Expand Down Expand Up @@ -260,35 +257,6 @@ def createSingleSphereMayaScene(directory=None):
cmds.file(save=True, force=True, type='mayaAscii')
return tempMayaFile

def previewReleaseVersion():
'''Return the Maya Preview Release version.

If the version of Maya is 2019, returns 98.

If the version of Maya is 2020, returns 110.

If the version of Maya is 2022, returns 122.

If the version of Maya is current and is not a Preview Release, returns
sys.maxsize (a very large number). If the environment variable
MAYA_PREVIEW_RELEASE_VERSION_OVERRIDE is defined, return its value instead.
'''

if 'MAYA_PREVIEW_RELEASE_VERSION_OVERRIDE' in os.environ:
return int(os.environ['MAYA_PREVIEW_RELEASE_VERSION_OVERRIDE'])

majorVersion = int(cmds.about(majorVersion=True))
if majorVersion == 2019:
return 98
elif majorVersion == 2020:
return 110
elif majorVersion == 2022:
return 122

match = prRe.match(cmds.about(v=True))

return int(match.group(1)) if match else sys.maxsize

def mayaMajorVersion():
return int(cmds.about(majorVersion=True))

Expand Down
Loading