Merge pull request #4795 from tokejepsen/bugfix/maya_get_color_management_preferences

This commit is contained in:
Ondřej Samohel 2023-04-12 14:53:29 +02:00 committed by GitHub
commit c76d7430ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3655,7 +3655,17 @@ def get_color_management_preferences():
# Split view and display from view_transform. view_transform comes in
# format of "{view} ({display})".
regex = re.compile(r"^(?P<view>.+) \((?P<display>.+)\)$")
if int(cmds.about(version=True)) <= 2020:
# view_transform comes in format of "{view} {display}" in 2020.
regex = re.compile(r"^(?P<view>.+) (?P<display>.+)$")
match = regex.match(data["view_transform"])
if not match:
raise ValueError(
"Unable to parse view and display from Maya view transform: '{}' "
"using regex '{}'".format(data["view_transform"], regex.pattern)
)
data.update({
"display": match.group("display"),
"view": match.group("view")