Skip to content

Commit 7e7ca54

Browse files
committed
Addressed CR comments
1 parent 95aec22 commit 7e7ca54

File tree

4 files changed

+40
-11
lines changed

4 files changed

+40
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ pip-log.txt
3434

3535
# Visual Studio
3636
.vs
37+
.vscode

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This file is based on templates provided and copyrighted by Autodesk, Inc.
2+
# This file has been modified by Epic Games, Inc. and is subject to the license
3+
# file included in this repository.
4+
5+
# Styles the code properly
6+
# Exclude the UI files, as they are auto-generated.
7+
exclude: "ui\/.*py$"
8+
# List of super useful formatters.
9+
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v2.4.0
12+
hooks:
13+
# Ensures the code is syntaxically correct
14+
- id: check-ast
15+
language_version: python3
16+
# Ensures a file name will resolve on all platform
17+
- id: check-case-conflict
18+
# Checks files with the execute bit set have shebangs
19+
- id: check-executables-have-shebangs
20+
# Ensure there's no incomplete merges
21+
- id: check-merge-conflict
22+
# Adds an empty line if missing at the end of a file.
23+
- id: end-of-file-fixer
24+
# Makes sure requirements.txt is properly formatted
25+
- id: requirements-txt-fixer
26+
# Removes trailing whitespaces.
27+
- id: trailing-whitespace
28+
# Leave black at the bottom so all touchups are done before it is run.
29+
- repo: https://github.com/ambv/black
30+
rev: 19.10b0
31+
hooks:
32+
- id: black
33+
language_version: python3
34+
35+

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ def collect_current_session(self, settings, parent_item):
8686
"""
8787
# Create the session item for the publish hierarchy
8888
# In Unreal, the current session can be defined as the current level/map (.umap)
89-
# display_name = "Current Unreal Session" # Could retrieve the level name
90-
# session_item = parent_item.create_item(
91-
# "unreal.session",
92-
# "Unreal Session",
93-
# display_name
94-
# )
95-
9689
# Don't create a session item for now since the .umap does not need to be published
9790
session_item = parent_item
9891

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ def validate(self, settings, item):
324324
# Check if we can use the Movie Render queue available from 4.26
325325
use_movie_render_queue = False
326326
render_presets = None
327-
if "MoviePipelineQueueEngineSubsystem" in dir(unreal):
328-
if "MoviePipelineAppleProResOutput" in dir(unreal):
327+
if hasattr(unreal, "MoviePipelineQueueEngineSubsystem"):
328+
if hasattr(unreal, "MoviePipelineAppleProResOutput"):
329329
use_movie_render_queue = True
330330
self.logger.info("Movie Render Queue will be used for rendering.")
331331
render_presets_path = settings["Movie Render Queue Presets Path"].value
@@ -357,7 +357,7 @@ def validate(self, settings, item):
357357
error_msg = "Missing keys required for the publish template " \
358358
"%s" % (missing_keys)
359359
self.logger.error(error_msg)
360-
raise Exception(error_msg)
360+
raise ValueError(error_msg)
361361

362362
item.properties["path"] = publish_template.apply_fields(fields)
363363
item.properties["publish_path"] = item.properties["path"]
@@ -570,7 +570,7 @@ def _unreal_render_sequence_with_sequencer(self, output_path, unreal_map_path, s
570570
movie_name = os.path.splitext(output_file)[0]
571571

572572
# First, check if there's a file that will interfere with the output of the Sequencer
573-
# Sequencer can only render to avi file format
573+
# Sequencer can only render to avi or mov file format
574574
if os.path.isfile(output_path):
575575
# Must delete it first, otherwise the Sequencer will add a number in the filename
576576
try:

0 commit comments

Comments
 (0)