From c264a6abf1a2c6605b9d7d51d2e2cdb6c0d9a63b Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Mon, 24 Jul 2023 08:14:57 +0100 Subject: [PATCH 1/5] Disable hardlinking. --- .../hosts/maya/plugins/publish/extract_look.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index e2c88ef44a..50a6db3bf7 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -6,7 +6,6 @@ import contextlib import json import logging import os -import platform import tempfile import six import attr @@ -585,14 +584,12 @@ class ExtractLook(publish.Extractor): resources = instance.data["resources"] color_management = lib.get_color_management_preferences() - # 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) + # Temporary disable all hardlinking, due to the feature not being used + # or properly working. + self.log.info( + "Forcing copy instead of hardlink." + ) + force_copy = True destinations_cache = {} From 1db5d5f838b78a4e807385ab5a202cd13134f1d5 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Fri, 28 Jul 2023 08:27:37 +0100 Subject: [PATCH 2/5] Ensure legacy_io_distinct is not used in AYON --- openpype/hosts/maya/plugins/publish/extract_look.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index 50a6db3bf7..ec01a817b3 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -18,6 +18,7 @@ from openpype.lib.vendor_bin_utils import find_executable from openpype.lib import source_hash, run_subprocess, get_oiio_tools_path from openpype.pipeline import legacy_io, publish, KnownPublishError from openpype.hosts.maya.api import lib +from openpype import AYON_SERVER_ENABLED # Modes for transfer COPY = 1 @@ -50,6 +51,12 @@ def find_paths_by_hash(texture_hash): str: path to texture if found. """ + if AYON_SERVER_ENABLED: + raise ValueError( + "This is a bug. \"find_paths_by_hash\" is not compatible with " + "AYON." + ) + key = "data.sourceHashes.{0}".format(texture_hash) return legacy_io.distinct(key, {"type": "version"}) From dfd748ccd191e3d6058529d8deaf2865c7a9ec89 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 22 Aug 2023 08:27:52 +0100 Subject: [PATCH 3/5] Remove force copy option --- openpype/hosts/maya/plugins/create/create_look.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/openpype/hosts/maya/plugins/create/create_look.py b/openpype/hosts/maya/plugins/create/create_look.py index 385ae81e01..11a69151fd 100644 --- a/openpype/hosts/maya/plugins/create/create_look.py +++ b/openpype/hosts/maya/plugins/create/create_look.py @@ -37,13 +37,7 @@ class CreateLook(plugin.MayaCreator): label="Convert textures to .rstex", tooltip="Whether to generate Redshift .rstex files for " "your textures", - default=self.rs_tex), - BoolDef("forceCopy", - label="Force Copy", - tooltip="Enable users to force a copy instead of hardlink." - "\nNote: On Windows copy is always forced due to " - "bugs in windows' implementation of hardlinks.", - default=False) + default=self.rs_tex) ] def get_pre_create_attr_defs(self): From 71bd10fffb7e3715108e0253203d28f32441998a Mon Sep 17 00:00:00 2001 From: Toke Jepsen Date: Tue, 5 Sep 2023 08:32:22 +0100 Subject: [PATCH 4/5] Update openpype/hosts/maya/plugins/publish/extract_look.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Samohel <33513211+antirotor@users.noreply.github.com> --- openpype/hosts/maya/plugins/publish/extract_look.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index ec01a817b3..043d88db6d 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -52,7 +52,7 @@ def find_paths_by_hash(texture_hash): """ if AYON_SERVER_ENABLED: - raise ValueError( + raise KnownPublishError( "This is a bug. \"find_paths_by_hash\" is not compatible with " "AYON." ) From 93a9ae2a6fa977b523de16b9f524e76d2d5fbf86 Mon Sep 17 00:00:00 2001 From: Toke Stuart Jepsen Date: Tue, 5 Sep 2023 08:33:49 +0100 Subject: [PATCH 5/5] Add TODO --- openpype/hosts/maya/plugins/publish/extract_look.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openpype/hosts/maya/plugins/publish/extract_look.py b/openpype/hosts/maya/plugins/publish/extract_look.py index 043d88db6d..2708a6d916 100644 --- a/openpype/hosts/maya/plugins/publish/extract_look.py +++ b/openpype/hosts/maya/plugins/publish/extract_look.py @@ -591,8 +591,8 @@ class ExtractLook(publish.Extractor): resources = instance.data["resources"] color_management = lib.get_color_management_preferences() - # Temporary disable all hardlinking, due to the feature not being used - # or properly working. + # TODO: Temporary disable all hardlinking, due to the feature not being + # used or properly working. self.log.info( "Forcing copy instead of hardlink." )