From 3f3932cff165a7b13be08f5f08de5097cd8a2d2c Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Wed, 21 Aug 2019 14:29:25 +0100 Subject: [PATCH] Enable "Force Copy" option. In cases where hardlinking is not an option (cloud syncing), copying is the only option. --- pype/plugins/maya/create/create_look.py | 3 +++ pype/plugins/maya/publish/extract_look.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/pype/plugins/maya/create/create_look.py b/pype/plugins/maya/create/create_look.py index 299fbafe02..49fd376db0 100644 --- a/pype/plugins/maya/create/create_look.py +++ b/pype/plugins/maya/create/create_look.py @@ -18,3 +18,6 @@ class CreateLook(avalon.maya.Creator): # Whether to automatically convert the textures to .tx upon publish. self.data["maketx"] = True + + # Enable users to force a copy. + self.data["forceCopy"] = False diff --git a/pype/plugins/maya/publish/extract_look.py b/pype/plugins/maya/publish/extract_look.py index f883f98412..c6ddd135d7 100644 --- a/pype/plugins/maya/publish/extract_look.py +++ b/pype/plugins/maya/publish/extract_look.py @@ -203,6 +203,11 @@ class ExtractLook(pype.api.Extractor): destination = self.resource_destination( instance, source, do_maketx ) + + # Force copy is specified. + if instance.data.get("forceCopy", False): + mode = COPY + if mode == COPY: transfers.append((source, destination)) elif mode == HARDLINK: