From 31daa488a985d1b0a7a69b5430d6b8274ed25194 Mon Sep 17 00:00:00 2001 From: dashielb1010 Date: Wed, 5 Jun 2019 12:14:49 -0700 Subject: [PATCH 1/2] Add setting to suppress warnings for empty shot names --- app.py | 21 +++++++++++++-------- info.yml | 5 +++++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 5e1eb1e..7705599 100644 --- a/app.py +++ b/app.py @@ -287,13 +287,14 @@ def pre_export_asset(self, session_id, info): # check that the clip has a shot name - otherwise things won't work! if shot_name == "": from sgtk.platform.qt import QtGui - QtGui.QMessageBox.warning( - None, - "Missing shot name!", - ("The clip '%s' does not have a shot name and therefore cannot be exported. " - "Please ensure that all shots you wish to exports " - "have been named. " % asset_name) - ) + if not self.get_setting("allow_empty_shot_names"): + QtGui.QMessageBox.warning( + None, + "Missing shot name!", + ("The clip '%s' does not have a shot name and therefore cannot be exported. " + "Please ensure that all shots you wish to export " + "have been named. " % asset_name) + ) # TODO: send the clip to the trash for now. no way to abort at this point # but we don't have enough information to be able to proceed at this point either @@ -423,7 +424,11 @@ def post_export_asset(self, session_id, info): if asset_type not in ["video", 'movie', "batch"]: # ignore anything that isn't video or batch return - + + if shot_name == "" and self.get_setting("allow_empty_shot_names"): + # continue more gracefully + return + # resolve shot object shot = self._sequences[-1].get_shot(shot_name) diff --git a/info.yml b/info.yml index df94a69..7395dc6 100644 --- a/info.yml +++ b/info.yml @@ -168,6 +168,11 @@ configuration: description: The publish type for Flame batch scripts default_value: "Flame Batch File" + allow_empty_shot_names: + description: If a sequence has at least one segment with a Shot name, ignore any other segments without a shot + name more gracefully. + type: bool + default_value: false # this app works in all engines - it does not contain From a1580803b4bbdf63bdd295f5f390c32d9f0569eb Mon Sep 17 00:00:00 2001 From: dashielb1010 Date: Wed, 5 Jun 2019 12:14:49 -0700 Subject: [PATCH 2/2] Add setting to suppress warnings for empty shot names --- app.py | 21 +++++++++++++-------- info.yml | 6 ++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/app.py b/app.py index 5e1eb1e..7705599 100644 --- a/app.py +++ b/app.py @@ -287,13 +287,14 @@ def pre_export_asset(self, session_id, info): # check that the clip has a shot name - otherwise things won't work! if shot_name == "": from sgtk.platform.qt import QtGui - QtGui.QMessageBox.warning( - None, - "Missing shot name!", - ("The clip '%s' does not have a shot name and therefore cannot be exported. " - "Please ensure that all shots you wish to exports " - "have been named. " % asset_name) - ) + if not self.get_setting("allow_empty_shot_names"): + QtGui.QMessageBox.warning( + None, + "Missing shot name!", + ("The clip '%s' does not have a shot name and therefore cannot be exported. " + "Please ensure that all shots you wish to export " + "have been named. " % asset_name) + ) # TODO: send the clip to the trash for now. no way to abort at this point # but we don't have enough information to be able to proceed at this point either @@ -423,7 +424,11 @@ def post_export_asset(self, session_id, info): if asset_type not in ["video", 'movie', "batch"]: # ignore anything that isn't video or batch return - + + if shot_name == "" and self.get_setting("allow_empty_shot_names"): + # continue more gracefully + return + # resolve shot object shot = self._sequences[-1].get_shot(shot_name) diff --git a/info.yml b/info.yml index 7bf6a9f..7e87fcd 100644 --- a/info.yml +++ b/info.yml @@ -173,6 +173,12 @@ configuration: description: Large requests will be broken until smaller requests of given chunk size to avoid timeout. default_value: 20 + allow_empty_shot_names: + description: If a sequence has at least one segment with a Shot name, ignore any other segments without a shot + name more gracefully. + type: bool + default_value: false + # this app works in all engines - it does not contain # any host application specific commands