Skip to content

Commit

Permalink
Maya is no longer using a Preview Release number
Browse files Browse the repository at this point in the history
Remove code (currently not used) that detected this.
  • Loading branch information
seando-adsk committed Feb 8, 2024
1 parent c02cd46 commit ac95e75
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
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

0 comments on commit ac95e75

Please sign in to comment.