Skip to content

Commit 91c7e47

Browse files
committed
Merge branch 'dev'
* dev: Updated turntable project to 4.23. Set the Maya publish_turntable plugin to use Unreal Engine 4.23 by default. Logged environment variables passed to turntable script. Updated turntable assets and scripts for 4.21/4.22
2 parents 1bc6874 + e512376 commit 91c7e47

27 files changed

+120
-14
lines changed

env/includes/settings/tk-multi-publish2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ settings.tk-multi-publish2.maya.asset_step:
186186
settings:
187187
Work Template: maya_ue4_turntable_render
188188
Publish Template: maya_ue4_turntable_publish
189-
Unreal Engine Version: "4.20"
189+
Unreal Engine Version: "4.23"
190190
Unreal Project Path: "{config}/tk-multi-publish2/tk-maya/unreal/resources/{unreal_engine_version}/turntable/turntable.uproject"
191191
Turntable Map Path: "/Game/turntable/level/turntable.umap"
192192
Sequence Path: "/Game/turntable/sequence/turntable_sequence.turntable_sequence"

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
HookBaseClass = sgtk.get_hook_baseclass()
1717

18+
# Environment variables for turntable script
19+
OUTPUT_PATH_ENVVAR = 'UNREAL_SG_FBX_OUTPUT_PATH'
20+
CONTENT_BROWSER_PATH_ENVVAR = 'UNREAL_SG_CONTENT_BROWSER_PATH'
21+
MAP_PATH_ENVVAR = 'UNREAL_SG_MAP_PATH'
22+
1823
class MayaUnrealTurntablePublishPlugin(HookBaseClass):
1924
"""
2025
Plugin for publishing an open maya session as an exported FBX.
@@ -397,19 +402,25 @@ def publish(self, settings, item):
397402
if " " in unreal_project_path:
398403
unreal_project_path = '"{}"'.format(unreal_project_path)
399404

400-
script_args = []
401-
405+
# Set the script arguments in the environment variables
402406
# The FBX to import into Unreal
403-
script_args.append(fbx_output_path)
404-
407+
os.environ[OUTPUT_PATH_ENVVAR] = fbx_output_path
408+
self.logger.info("Setting environment variable {} to {}".format(OUTPUT_PATH_ENVVAR, fbx_output_path))
409+
405410
# The Unreal content browser folder where the asset will be imported into
406-
script_args.append(unreal_content_browser_path)
411+
os.environ[CONTENT_BROWSER_PATH_ENVVAR] = unreal_content_browser_path
412+
self.logger.info("Setting environment variable {} to {}".format(CONTENT_BROWSER_PATH_ENVVAR, unreal_content_browser_path))
407413

408414
# The Unreal turntable map to duplicate where the asset will be instantiated into
409-
script_args.append(turntable_map_path)
415+
os.environ[MAP_PATH_ENVVAR] = turntable_map_path
416+
self.logger.info("Setting environment variable {} to {}".format(MAP_PATH_ENVVAR, turntable_map_path))
417+
418+
self._unreal_execute_script(unreal_exec_path, unreal_project_path, script_path)
419+
420+
del os.environ[OUTPUT_PATH_ENVVAR]
421+
del os.environ[CONTENT_BROWSER_PATH_ENVVAR]
422+
del os.environ[MAP_PATH_ENVVAR]
410423

411-
self._unreal_execute_script(unreal_exec_path, unreal_project_path, script_path, script_args)
412-
413424
# =======================
414425
# 4. Render the turntable to movie.
415426
# Output the movie to the publish path
@@ -539,12 +550,12 @@ def _maya_export_fbx(self, fbx_output_path):
539550

540551
return True
541552

542-
def _unreal_execute_script(self, unreal_exec_path, unreal_project_path, script_path, script_args):
553+
def _unreal_execute_script(self, unreal_exec_path, unreal_project_path, script_path):
543554
command_args = []
544555
command_args.append(unreal_exec_path) # Unreal executable path
545556
command_args.append(unreal_project_path) # Unreal project
546557

547-
command_args.append('-ExecutePythonScript="{} {}"'.format(script_path, " ".join(script_args)))
558+
command_args.append('-ExecutePythonScript="{}"'.format(script_path))
548559
self.logger.info("Executing script in Unreal with arguments: {}".format(command_args))
549560

550561
print "COMMAND ARGS: %s" % (command_args)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[URL]
2+
3+
[/Script/HardwareTargeting.HardwareTargetingSettings]
4+
TargetedHardwareClass=Desktop
5+
AppliedTargetedHardwareClass=Desktop
6+
DefaultGraphicsPerformance=Maximum
7+
AppliedDefaultGraphicsPerformance=Maximum
8+
9+
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
10+
bSupportsPortraitOrientation=False
11+
bSupportsUpsideDownOrientation=False
12+
bSupportsLandscapeLeftOrientation=True
13+
PreferredLandscapeOrientation=LandscapeLeft
14+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[/Script/EngineSettings.GeneralProjectSettings]
2+
ProjectID=B6599CB54F66B6CFD93DC3A95CB55C3D
628 KB
Binary file not shown.
1.08 MB
Binary file not shown.
69.7 KB
Binary file not shown.
20.5 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"FileVersion": 3,
3+
"EngineAssociation": "4.21",
4+
"Category": "",
5+
"Description": "",
6+
"Enterprise": true,
7+
"Plugins": [
8+
{
9+
"Name": "PythonScriptPlugin",
10+
"Enabled": true
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)