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
Show file tree
Hide file tree
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 - added collector for originalDirname
  • Loading branch information
kalisp committed Dec 14, 2022
commit 9bf00f9cfebb4c5b0ec6586672308d1a74cd6376
16 changes: 0 additions & 16 deletions openpype/plugins/publish/collect_resources_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,3 @@ def process(self, instance):

self.log.debug("publishDir: \"{}\"".format(publish_folder))
self.log.debug("resourcesDir: \"{}\"".format(resources_folder))

# parse folder name and file name for online and source templates
# currentFile comes from hosts workfiles
# source comes from Publisher
current_file = instance.data.get("currentFile")
source = instance.data.get("source")
source_file = current_file or source
if source_file and os.path.exists(source_file):
self.log.debug("Parsing paths for {}".format(source_file))
if not instance.data.get("originalBasename"):
instance.data["originalBasename"] = \
os.path.basename(source_file)

if not instance.data.get("originalDirname"):
instance.data["originalDirname"] = \
os.path.dirname(source_file)
43 changes: 43 additions & 0 deletions openpype/plugins/publish/collect_source_for_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"""
Requires:
instance -> currentFile
instance -> source

Provides:
instance -> originalBasename
instance -> originalDirname
"""

import os
import copy

import pyblish.api


class CollectSourceForSource(pyblish.api.InstancePlugin):
"""Collects source location of file for instance.

Used for 'source' template name which handles in place publishing.
For this kind of publishing files are present with correct file name
pattern and correct location.
"""

label = "Collect Source"
order = pyblish.api.CollectorOrder + 0.495

def process(self, instance):
# parse folder name and file name for online and source templates
# currentFile comes from hosts workfiles
# source comes from Publisher
current_file = instance.data.get("currentFile")
source = instance.data.get("source")
source_file = current_file or source
if source_file and os.path.exists(source_file):
self.log.debug("Parsing paths for {}".format(source_file))
if not instance.data.get("originalBasename"):
instance.data["originalBasename"] = \
os.path.basename(source_file)

if not instance.data.get("originalDirname"):
instance.data["originalDirname"] = \
os.path.dirname(source_file)