From 215da09d3dcf92138eeddfc97bf48a9fd5728729 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 15:24:23 +0200 Subject: [PATCH 1/3] Change default value of force copy to True --- openpype/hosts/maya/plugins/create/create_look.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/create/create_look.py b/openpype/hosts/maya/plugins/create/create_look.py index 56e2640919..d9521d1860 100644 --- a/openpype/hosts/maya/plugins/create/create_look.py +++ b/openpype/hosts/maya/plugins/create/create_look.py @@ -22,4 +22,4 @@ class CreateLook(plugin.Creator): self.data["maketx"] = self.make_tx # Enable users to force a copy. - self.data["forceCopy"] = False + self.data["forceCopy"] = True From 8eab6ae180fe308e03bc4d3df7cd53bd030b59ce Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 16:25:37 +0200 Subject: [PATCH 2/3] disable hardlink on windows for look publishing --- openpype/hosts/maya/plugins/create/create_look.py | 4 +++- openpype/hosts/maya/plugins/publish/extract_look.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_look.py b/openpype/hosts/maya/plugins/create/create_look.py index d9521d1860..44e439fe1f 100644 --- a/openpype/hosts/maya/plugins/create/create_look.py +++ b/openpype/hosts/maya/plugins/create/create_look.py @@ -22,4 +22,6 @@ class CreateLook(plugin.Creator): self.data["maketx"] = self.make_tx # Enable users to force a copy. - self.data["forceCopy"] = True + # - on Windows is "forceCopy" always changed to `True` because of + # windows implementation of hardlinks + self.data["forceCopy"] = False diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index a8893072d0..137683ca6d 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -4,6 +4,7 @@ import os import sys import json import tempfile +import platform import contextlib import subprocess from collections import OrderedDict @@ -334,7 +335,11 @@ class ExtractLook(openpype.api.Extractor): transfers = [] hardlinks = [] hashes = {} - force_copy = instance.data.get("forceCopy", False) + # Temporary fix to NOT create hardlinks on windows machines + if platform.system().lower() == "windows": + force_copy = True + else: + force_copy = instance.data.get("forceCopy", False) for filepath in files_metadata: From 8940830787fc68d043febecd26040d944e5d91d9 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 30 Mar 2022 16:38:45 +0200 Subject: [PATCH 3/3] added info log about changing hardlink --- openpype/hosts/maya/plugins/publish/extract_look.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index 137683ca6d..6fcc308f78 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -337,6 +337,9 @@ class ExtractLook(openpype.api.Extractor): hashes = {} # Temporary fix to NOT create hardlinks on windows machines if platform.system().lower() == "windows": + self.log.info( + "Forcing copy instead of hardlink due to issues on Windows..." + ) force_copy = True else: force_copy = instance.data.get("forceCopy", False)