Skip to content

Commit 3086cbb

Browse files
authored
7675 linux polish (#9)
Disabled things which make Unreal crash or which are not fully working.
1 parent 14eab3f commit 3086cbb

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

engine.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,12 @@ def _create_dialog(self, title, bundle, widget, parent):
268268

269269
from sgtk.platform.qt import QtGui
270270

271-
unreal_icon = os.path.realpath(os.path.join(
272-
os.path.dirname(__file__),
273-
"icon_256.png"))
274-
271+
unreal_icon = os.path.realpath(
272+
os.path.join(
273+
os.path.dirname(__file__),
274+
"icon_256.png"
275+
)
276+
)
275277
dialog.setWindowIcon(QtGui.QIcon(unreal_icon))
276278
return dialog
277279

hooks/tk-multi-publish2/basic/publish_movie.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,17 @@ def accept(self, settings, item):
319319
"""
320320

321321
accepted = True
322-
publisher = self.parent
322+
checked = True
323323

324+
if sys.platform != "win32":
325+
self.logger.warning(
326+
"Movie publishing is not supported on other platforms than Windows..."
327+
)
328+
return {
329+
"accepted": False,
330+
}
331+
332+
publisher = self.parent
324333
# ensure the publish template is defined
325334
publish_template_setting = settings.get("Publish Template")
326335
publish_template = publisher.get_template_by_name(publish_template_setting.value)
@@ -337,7 +346,7 @@ def accept(self, settings, item):
337346
self.load_saved_ui_settings(settings)
338347
return {
339348
"accepted": accepted,
340-
"checked": True
349+
"checked": checked
341350
}
342351

343352
def validate(self, settings, item):

startup.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,20 @@ def prepare_launch(self, exec_path, args, file_to_open=None):
6161
6262
:returns: A :class:`LaunchInformation` instance.
6363
"""
64+
# TODO: Get the startup project from settings somewhere, for now hardcoded
65+
# Otherwise, leave it empty and the project selection window will appear
66+
# (the command-line arguments are forwarded to the new instance of Unreal Editor)
67+
unreal_project = ""
68+
args = args + unreal_project
6469
required_env = {}
70+
# Creating a QApplication in Unreal on Mac crashes it, so disable the
71+
# SG TK integration for now, just run the executable with its args. This
72+
# allows to launch Unreal from tk-desktop or submit turntable renders
73+
# from Maya to Unreal, without the integration crashing Unreal.
74+
if sys.platform == "darwin":
75+
self.logger.warning("SG TK Unreal integration is not available on Mac.")
76+
return LaunchInformation(exec_path, args, required_env)
77+
6578
# Usually DCCs have an environment variable for plugins that need to be loaded.
6679
# Here we're adding ourselves to that list. We add ourselves to the existing one
6780
# in fact so we play nice with the current environment.
@@ -76,12 +89,6 @@ def prepare_launch(self, exec_path, args, file_to_open=None):
7689
# Signals which engine instance from the environment is going to be used.
7790
required_env["SHOTGUN_ENGINE"] = self.engine_name
7891

79-
# TODO: Get the startup project from settings somewhere, for now hardcoded
80-
# Otherwise, leave it empty and the project selection window will appear
81-
# (the command-line arguments are forwarded to the new instance of Unreal Editor)
82-
unreal_project = ""
83-
args = args + unreal_project
84-
8592
# Set the bootstrap location in the environment variable that will be used by the Unreal Shotgun startup script
8693
bootstrap_script = os.path.join(self.disk_location, "plugins", "basic", "bootstrap.py")
8794
required_env["UE_SHOTGUN_BOOTSTRAP"] = bootstrap_script

0 commit comments

Comments
 (0)