diff --git a/openpype/lib/delivery.py b/openpype/lib/delivery.py index d5b18bca0a..9e87d854f5 100644 --- a/openpype/lib/delivery.py +++ b/openpype/lib/delivery.py @@ -125,7 +125,7 @@ def check_destination_path(repre_id, def process_single_file( - src_path, _repre, anatomy, template_name, anatomy_data, format_dict, + src_path, repre, anatomy, template_name, anatomy_data, format_dict, report_items, log ): """Copy single file to calculated path based on template @@ -143,6 +143,12 @@ def process_single_file( Returns: (collections.defaultdict , int) """ + if not os.path.exists(src_path): + msg = "{} doesn't exist for {}".format(src_path, + repre["_id"]) + report_items["Source file was not found"].append(msg) + return report_items, 0 + anatomy_filled = anatomy.format(anatomy_data) if format_dict: template_result = anatomy_filled["delivery"][template_name] @@ -150,6 +156,9 @@ def process_single_file( else: delivery_path = anatomy_filled["delivery"][template_name] + # context.representation could be .psd + delivery_path = delivery_path.replace("..", ".") + delivery_folder = os.path.dirname(delivery_path) if not os.path.exists(delivery_folder): os.makedirs(delivery_folder) @@ -186,6 +195,12 @@ def process_sequence( Returns: (collections.defaultdict , int) """ + if not os.path.exists(src_path): + msg = "{} doesn't exist for {}".format(src_path, + repre["_id"]) + report_items["Source file was not found"].append(msg) + return report_items, 0 + dir_path, file_name = os.path.split(str(src_path)) context = repre["context"] @@ -198,6 +213,8 @@ def process_sequence( return report_items, 0 ext = "." + ext + # context.representation could be .psd + ext = ext.replace("..", ".") src_collections, remainder = clique.assemble(os.listdir(dir_path)) src_collection = None diff --git a/openpype/plugins/load/delivery.py b/openpype/plugins/load/delivery.py index f2dc94c636..360ef4af82 100644 --- a/openpype/plugins/load/delivery.py +++ b/openpype/plugins/load/delivery.py @@ -28,7 +28,7 @@ class Delivery(api.SubsetLoader): representations = ["*"] families = ["*"] - # tool_names = ["library_loader"] + tool_names = ["library_loader"] label = "Deliver Versions" order = 35 @@ -173,11 +173,6 @@ class DeliveryOptionsDialog(QtWidgets.QDialog): continue repre_path = path_from_represenation(repre, anatomy) - if not os.path.exists(repre_path): - msg = "{} doesn't exist for {}".format(repre_path, - repre["_id"]) - report_items["Source file was not found"].append(msg) - continue anatomy_data = copy.deepcopy(repre["context"]) new_report_items = check_destination_path(str(repre["_id"]),