Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Publish: register publishes without copying them #4157

Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
59b4f58
OP-4504 - added originalBasename and originalDirname to instance
kalisp Dec 1, 2022
5aed3f9
OP-4504 - added originalDirname to data filling template
kalisp Dec 1, 2022
07ee68e
OP-4504 - added checks for not overwriting same file
kalisp Dec 1, 2022
3eb9672
Merge branch 'develop' of github.com:pypeclub/OpenPype into feature/O…
kalisp Dec 1, 2022
0aa0080
OP-4504 - fixed check file in project folder
kalisp Dec 1, 2022
2327438
OP-4504 - moved path parsing to global plugin
kalisp Dec 1, 2022
499c321
OP-4504 - revert of unwanted change
kalisp Dec 1, 2022
9c381b4
OP-4504 - added logic for originalDirname into integrate
kalisp Dec 1, 2022
1106f8c
OP-4504 - check for None
kalisp Dec 1, 2022
b67c8e2
OP-4504 - cleanup of logic
kalisp Dec 1, 2022
ddfaae8
OP-4504 - added source template to defaults
kalisp Dec 2, 2022
af3ebeb
OP-4504 - Hound
kalisp Dec 2, 2022
d971f9e
OP-4504 - merge develop
kalisp Dec 6, 2022
d1ee451
OP-4504 - update logging
kalisp Dec 6, 2022
ea27412
Merge remote-tracking branch 'origin/bugfix/integrate_thumbnail_sourc…
kalisp Dec 6, 2022
c208a82
Merge remote-tracking branch 'origin/bugfix/integrate_thumbnail_sourc…
kalisp Dec 6, 2022
c9496bc
OP-4504 - change boolean test to validation with exception
kalisp Dec 7, 2022
3fabd51
OP-4504 - weird unpacking not necessary
kalisp Dec 7, 2022
0a12a42
OP-4504 - use existing method to check if path in project
kalisp Dec 7, 2022
cccd9c6
OP-4504 - logging message is wrong as it is called on instances also
kalisp Dec 7, 2022
30eca6f
OP-4504 - fix default source template
kalisp Dec 7, 2022
4c53a77
OP-4504 - make root comparison case insensitive for windows
kalisp Dec 7, 2022
726c8f2
OP-4504 - fix resolving of originalDirname
kalisp Dec 7, 2022
a1f85d3
OP-4504 - use always stagingDir from instance instead of repre
kalisp Dec 7, 2022
d8ed899
OP-4504 - removed unwanted lower
kalisp Dec 7, 2022
98f45c2
OP-4504 - Hound
kalisp Dec 7, 2022
f3481dd
Merge branch 'develop' into feature/OP-4504_Publishing-Register-publi…
kalisp Dec 7, 2022
663538c
Merge develop
kalisp Dec 12, 2022
fe0336c
OP-4504 - removed path comparison function
kalisp Dec 12, 2022
a1a50a6
OP-4504 conflict resolution
kalisp Dec 12, 2022
d18fc94
OP-4504 - fix for deadline publishing
kalisp Dec 12, 2022
8a267f6
OP-4504 - handle originalDirname only if in template
kalisp Dec 12, 2022
9bf00f9
OP-4504 - added collector for originalDirname
kalisp Dec 14, 2022
3cf3fd6
OP-4504 - added validator for source template
kalisp Dec 14, 2022
d9a7d5c
OP-4504 - Hound
kalisp Dec 14, 2022
51c7925
Merge branch 'develop' of github.com:pypeclub/OpenPype into feature/O…
kalisp Dec 14, 2022
a3969f8
Update openpype/plugins/publish/validate_publish_dir.py
kalisp Dec 15, 2022
ee58c0c
OP-4504 - changed to XMLPublishError
kalisp Dec 15, 2022
da274a7
OP-4504 - safer comparison of two paths
kalisp Dec 15, 2022
b6873a0
OP-4504 - added '_thumb' suffix to thumbnail
kalisp Dec 15, 2022
e3866df
OP-4504 - remove check for existence
kalisp Dec 15, 2022
3c09dfc
OP-4504 - remove extension from originalBasename
kalisp Dec 15, 2022
5d8ddb6
OP-4504 - added explicit check
kalisp Dec 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OP-4504 - handle originalDirname only if in template
  • Loading branch information
kalisp committed Dec 12, 2022
commit 8a267f6c340bc31d4c15dd5d90bc7c534d1a03af
24 changes: 15 additions & 9 deletions openpype/plugins/publish/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,6 @@ def register(self, instance, file_transactions, filtered_repres):
instance)

for src, dst in prepared["transfers"]:
self._validate_path_in_project_roots(anatomy, dst)

# todo: add support for hardlink transfers
file_transactions.add(src, dst)

Expand Down Expand Up @@ -576,13 +574,21 @@ def prepare_representation(self, repre,

is_udim = bool(repre.get("udim"))

# store as originalDirname only original value without project root
# if instance collected originalDirname it should be used for all repre
# useful to storing transient items, eg. thumbnails, from temp to final
original_directory = (
instance.data.get("originalDirname") or instance_stagingdir)
if original_directory:
# handle publish in place
if "originalDirname" in template:
# store as originalDirname only original value without project root
# if instance collected originalDirname is present, it should be
# used for all represe
# from temp to final
original_directory = (
instance.data.get("originalDirname") or instance_stagingdir)

_rootless = self.get_rootless_path(anatomy, original_directory)
if _rootless == original_directory:
raise KnownPublishError((
"Destination path '{}' ".format(original_directory) +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

continuation line over-indented for hanging indent

"must be in project dir"
))
relative_path_start = _rootless.rfind('}') + 2
without_root = _rootless[relative_path_start:]
template_data["originalDirname"] = without_root
Expand Down Expand Up @@ -923,6 +929,6 @@ def _validate_path_in_project_roots(self, anatomy, file_path):
path = self.get_rootless_path(anatomy, file_path)
if not path:
raise KnownPublishError((
"Destination path {} ".format(file_path) +
"Destination path '{}' ".format(file_path) +
"must be in project dir"
))