-
Notifications
You must be signed in to change notification settings - Fork 127
Publish: register publishes without copying them #4157
Publish: register publishes without copying them #4157
Conversation
Will be used to fill 'source' (and 'online') template. Source template is used to publish in-situ, eg. without copying possibly massive files (as pointcaches etc.)
Will be used to fill 'source' (and 'online') template.
Added check for publishing to project folder
…P-4504_Publishing-Register-publishes-without-copying-them
CollectSources should run on all hosts whenever some output is expected. It seems to be best location to put parsing of source file, unless we want to create completely new separate plugin.
Adding originalDirname to all hosts could be an ordeal, adding logic here is simpler, but might not be best solution.
Source template is used in-situ publishing, eg. use files at their location, don't copy them anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested it in Tray Publisher and found strange problem with Extract Thumbnail (from source)
- this is producing jpg file from input, but it is placed in staging directory like C:\Users\annat\AppData\Local\Temp\pyblish_tmp_tduppdsg\VFX025_00001.jpg
in my testing data.
Now integrator will skip copying it:
WARNING: Destination 'e:/projects/foo/bar/vfx025/vfx_out/v10/vfx025_00001.jpg' is not in project folder. Skipping
but since it is in staging tmp directory it will never be find by integrator when registering.
To wrap it up: We need to handle moving stuff produced during the publishing process that is generated into temporary destinations even if the source
template is used.
…e' into feature/OP-4504_Publishing-Register-publishes-without-copying-them
…e' into feature/OP-4504_Publishing-Register-publishes-without-copying-them
# optionals | ||
# retrieve additional anatomy data from representation if exists | ||
if not instance.data.get("originalDirname"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say original dirname and basename is representation specific and not instance specific.
EDITED:
The dirname is used for all representations. But I think it should be always set to staging dir from instance and never from representation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, used instance_stagingdir
instead.
We must be carefull about original basename because thumbnail extractors use same name as source so if I'm 90% convinced that template in anatomy should look like Another question is if the |
Obsolete as it is part of file_transaction file
Check is output template is 'source' if originalDirname is collected and if it is inside of project
_rootless = self.get_rootless_path(anatomy, original_directory) | ||
if _rootless == original_directory: | ||
raise KnownPublishError(( | ||
"Destination path '{}' ".format(original_directory) + |
There was a problem hiding this comment.
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
Added explicit collector and validator to check if source file is in project folder. |
…P-4504_Publishing-Register-publishes-without-copying-them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will publish, but during the publishing it does strange things with the name. Here is a piece of log from the integrator:
DEBUG: Source: P:\PROJECTS\OP01_CG_demo\tests\tree-736885_960_720.jpg
DEBUG: Creating new version ...
INFO: Prepared version: v002
DEBUG: Anatomy template name: source
DEBUG: Anatomy template name: source
WARNING: File transfer in queue replaced..
DEBUG: Removed from queue: P:\PROJECTS\OP01_CG_demo\tests\tree-736885_960_720.jpg -> P:\PROJECTS\op01_cg_demo\tests\tree-736885_960_720.jpg.jpg replaced by C:\Users\annat\AppData\Local\Temp\pyblish_tmp_3fx1tx9p\tree-736885_960_720.jpg -> P:\PROJECTS\op01_cg_demo\tests\tree-736885_960_720.jpg.jpg
DEBUG: Anatomy template name: source
INFO: Subset renderAnimationMain and Version 2 written to database..
DEBUG: Integrating source files to destination ...
DEBUG: Copying file ... C:\Users\annat\AppData\Local\Temp\pyblish_tmp_3fx1tx9p\tree-736885_960_720.jpg -> P:\PROJECTS\op01_cg_demo\tests\tree-736885_960_720.jpg.jpg
DEBUG: Copying file ... P:\PROJECTS\OP01_CG_demo\tests\tree-736885_960_720_png.png -> P:\PROJECTS\op01_cg_demo\tests\tree-736885_960_720_png.png.png
Again, note the extensions...
Co-authored-by: Ondřej Samohel <33513211+antirotor@users.noreply.github.com>
Without it thumbnail would overwrite source file
For sequences source contains `%d` placeholder
It would produce weird concatenation of extensions.
@@ -91,7 +91,7 @@ def process(self, instance): | |||
full_input_path = os.path.join(src_staging, input_file) | |||
self.log.info("input {}".format(full_input_path)) | |||
filename = os.path.splitext(input_file)[0] | |||
jpeg_file = filename + ".jpg" | |||
jpeg_file = filename + "_thumb.jpg" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use full name for suffix.
jpeg_file = filename + "_thumb.jpg" | |
jpeg_file = filename + "_thumbnail.jpg" |
Opinions @antirotor @kalisp @mkolar @jakubjezek001 ?
What about other thumbnail extractors (e.g. in Maya)?
Co-authored-by: Jakub Trllo <43494761+iLLiCiTiT@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to report that it works as expected!
Brief description
This PR introduces 'source' publish template which could be used in 'in-place' publish, eg. files are published from their current location without copying them into 'publish' folder.
Description
This kind of publishing helps with massive files as pointcaches or renders when files are already created in proper location. Without copying publish process takes less time.
Additional logic to check that publish path is inside of project data folder (eg. in at least one configured root in Anatomy) to protect from publishing to "my C:/ folder".
!!!
ExtractThumbnail*
plugins are now adding_thumb
suffix to names (my_project_seq02_shot01_renderCompositingMain_v018.1004_thumb.jpg
)Additional details
originalDirname
was added to collector for resources, but some subset might be created only during Extract phase, so it was added also intointegrate
plugin, which might not be optimal. Comments welcomed.I tested it in DCC with render which ended up in
work/.../renders
subfolders which doesn't seem too right, as they might be purged (they weren't in Maya and Nuke though).Testing notes:
project_anatomy/templates/others
project_settings/global/publish/IntegrateAssetNew
or better inproject_settings/global/tools/publish/template_name_profiles
(see deprecation warning and move template profiles to later location) (I tested in on combinationTraypublisher
-render
andMaya
-render
data.path: "URL_OF_DRAGGED_FILE"
, no new version subfolder should be created inpublish
folder