Skip to content

Commit cc167c0

Browse files
authored
13673 maya 2025 (#2)
* For #13673, support for Maya 2025 Removed all six dependencies. Added support for PySide6.
1 parent f4a5be3 commit cc167c0

File tree

3 files changed

+31
-30
lines changed

3 files changed

+31
-30
lines changed

hooks/core/bootstrap.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
# Copyright 2020 GPL Solutions, LLC. All rights reserved.
2-
#
3-
# Use of this software is subject to the terms of the GPL Solutions license
4-
# agreement provided at the time of installation or download, or which otherwise
5-
# accompanies this software in either electronic or hard copy form.
6-
#
1+
# This file is provided by Epic Games, Inc. and is subject to the license
2+
# file included in this repository.
73

84
"""
95
This hook is used override some of the functionality of the :class:`~sgtk.bootstrap.ToolkitManager`.
@@ -34,8 +30,8 @@ class Bootstrap(get_hook_baseclass()):
3430
Override the bootstrap core hook to cache ourself some bundles.
3531
http://developer.shotgunsoftware.com/tk-core/core.html#bootstrap.Bootstrap
3632
"""
37-
# List of github repos for which we download releases, with a token to do
38-
# the download
33+
# List of github repos for which we download releases, with a github token to
34+
# do the download if the repo is private
3935
_download_release_from_github = [
4036
("ue4plugins/tk-framework-unrealqt", ""),
4137
("GPLgithub/tk-framework-unrealqt", ""),

hooks/tk-multi-publish2/tk-maya/basic/publish_fbx.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import maya.mel as mel
88
import sgtk
99
from sgtk.util.filesystem import ensure_folder_exists
10-
from tank_vendor import six
1110

1211
HookBaseClass = sgtk.get_hook_baseclass()
1312

@@ -363,13 +362,9 @@ def finalize(self, settings, item):
363362
def _session_path():
364363
"""
365364
Return the path to the current session
366-
:return:
365+
:return: A string or ``None``.
367366
"""
368367
path = cmds.file(query=True, sn=True)
369-
370-
if path is not None:
371-
path = six.ensure_str(path)
372-
373368
return path
374369

375370

hooks/tk-multi-publish2/tk-maya/basic/publish_turntable.py

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import subprocess
2020
import sys
2121
import tempfile
22-
from six.moves.urllib import parse
22+
from urllib import parse
2323

2424
HookBaseClass = sgtk.get_hook_baseclass()
2525

@@ -40,9 +40,19 @@ def __init__(self, with_open_button=False, *args, **kwargs):
4040
self.combo_box.setEditable(True)
4141
self.combo_box.setMaxVisibleItems(10)
4242
# Prevent the QComboBox to get too big if the path is long.
43-
self.combo_box.setSizeAdjustPolicy(
44-
QtGui.QComboBox.AdjustToMinimumContentsLength
45-
)
43+
engine = sgtk.platform.current_engine()
44+
# Note: it would be better to test for Qt4 or Qt5 so this
45+
# wouldn't have to be changed when moving to new major
46+
# releases of Qt, but has_qt4 and has_qt5 returns True
47+
# even when PySide6 is being used.
48+
if engine.has_qt6:
49+
self.combo_box.setSizeAdjustPolicy(
50+
QtGui.QComboBox.AdjustToMinimumContentsLengthWithIcon
51+
)
52+
else: # Qt4 or Qt5
53+
self.combo_box.setSizeAdjustPolicy(
54+
QtGui.QComboBox.AdjustToMinimumContentsLength
55+
)
4656

4757
self.open_button = QtGui.QToolButton()
4858
icon = QtGui.QIcon()
@@ -92,7 +102,7 @@ def get_path(self):
92102
93103
:returns: An utf-8 encoded string.
94104
"""
95-
return six.ensure_str(self.combo_box.currentText())
105+
return self.combo_box.currentText()
96106

97107
def set_path(self, path):
98108
"""
@@ -540,14 +550,14 @@ def get_ui_settings(self, widget):
540550
# Please note that we don't have to return all settings here, just the
541551
# settings which are editable in the UI.
542552
settings = {
543-
"Unreal Engine Version": six.ensure_str(widget.unreal_setup_widget.unreal_version),
544-
"Unreal Engine Path": six.ensure_str(widget.unreal_setup_widget.unreal_path),
553+
"Unreal Engine Version": widget.unreal_setup_widget.unreal_version,
554+
"Unreal Engine Path": widget.unreal_setup_widget.unreal_path,
545555
# Get the project path evaluated from the template or the value which
546556
# was manually set.
547-
"Unreal Project Path": six.ensure_str(widget.unreal_setup_widget.unreal_project_path),
548-
"Turntable Map Path": six.ensure_str(widget.unreal_turntable_map_widget.text()),
549-
"Sequence Path": six.ensure_str(widget.unreal_sequence_widget.text()),
550-
"Turntable Assets Path": six.ensure_str(widget.unreal_turntable_asset_widget.text()),
557+
"Unreal Project Path": widget.unreal_setup_widget.unreal_project_path,
558+
"Turntable Map Path": widget.unreal_turntable_map_widget.text(),
559+
"Sequence Path": widget.unreal_sequence_widget.text(),
560+
"Turntable Assets Path": widget.unreal_turntable_asset_widget.text(),
551561
# "HDR Path": widget.hdr_image_template_widget.get_path(),
552562
# "Start Frame": widget.start_frame_spin_box.value(),
553563
# "End Frame": widget.end_frame_spin_box.value(),
@@ -1083,13 +1093,13 @@ def publish(self, settings, item):
10831093
# "environment can only contain strings" erors will happen.
10841094
extra_env = {
10851095
# The FBX to import into Unreal
1086-
"UNREAL_SG_FBX_OUTPUT_PATH": six.ensure_str(fbx_output_path),
1096+
"UNREAL_SG_FBX_OUTPUT_PATH": fbx_output_path,
10871097
# The Unreal content browser folder where the asset will be imported into
1088-
"UNREAL_SG_ASSETS_PATH": six.ensure_str(turntable_assets_path),
1098+
"UNREAL_SG_ASSETS_PATH": turntable_assets_path,
10891099
# The Unreal turntable map to duplicate where the asset will be instantiated into
1090-
"UNREAL_SG_MAP_PATH": six.ensure_str(turntable_map_path),
1091-
"UNREAL_SG_SEQUENCE_PATH": six.ensure_str(sequence_path),
1092-
"UNREAL_SG_MOVIE_OUTPUT_PATH": six.ensure_str(publish_path),
1100+
"UNREAL_SG_MAP_PATH": turntable_map_path,
1101+
"UNREAL_SG_SEQUENCE_PATH": sequence_path,
1102+
"UNREAL_SG_MOVIE_OUTPUT_PATH": publish_path,
10931103
}
10941104
self.logger.info("Adding %s to the environment" % extra_env)
10951105
run_env.update(extra_env)

0 commit comments

Comments
 (0)