19
19
import subprocess
20
20
import sys
21
21
import tempfile
22
- from six . moves . urllib import parse
22
+ from urllib import parse
23
23
24
24
HookBaseClass = sgtk .get_hook_baseclass ()
25
25
@@ -40,9 +40,19 @@ def __init__(self, with_open_button=False, *args, **kwargs):
40
40
self .combo_box .setEditable (True )
41
41
self .combo_box .setMaxVisibleItems (10 )
42
42
# 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
+ )
46
56
47
57
self .open_button = QtGui .QToolButton ()
48
58
icon = QtGui .QIcon ()
@@ -92,7 +102,7 @@ def get_path(self):
92
102
93
103
:returns: An utf-8 encoded string.
94
104
"""
95
- return six . ensure_str ( self .combo_box .currentText () )
105
+ return self .combo_box .currentText ()
96
106
97
107
def set_path (self , path ):
98
108
"""
@@ -540,14 +550,14 @@ def get_ui_settings(self, widget):
540
550
# Please note that we don't have to return all settings here, just the
541
551
# settings which are editable in the UI.
542
552
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 ,
545
555
# Get the project path evaluated from the template or the value which
546
556
# 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 (),
551
561
# "HDR Path": widget.hdr_image_template_widget.get_path(),
552
562
# "Start Frame": widget.start_frame_spin_box.value(),
553
563
# "End Frame": widget.end_frame_spin_box.value(),
@@ -1083,13 +1093,13 @@ def publish(self, settings, item):
1083
1093
# "environment can only contain strings" erors will happen.
1084
1094
extra_env = {
1085
1095
# 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 ,
1087
1097
# 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 ,
1089
1099
# 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 ,
1093
1103
}
1094
1104
self .logger .info ("Adding %s to the environment" % extra_env )
1095
1105
run_env .update (extra_env )
0 commit comments