mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #290 from tokejepsen/2.x/feature/photoshop_increment_workfile
Increment workfile
This commit is contained in:
commit
d23339eec6
2 changed files with 30 additions and 2 deletions
|
|
@ -22,8 +22,7 @@ class IncrementWorkfile(pyblish.api.InstancePlugin):
|
|||
errored_plugins = get_errored_plugins_from_data(instance.context)
|
||||
if errored_plugins:
|
||||
raise RuntimeError(
|
||||
"Skipping incrementing current file because submission to"
|
||||
" deadline failed."
|
||||
"Skipping incrementing current file because publishing failed."
|
||||
)
|
||||
|
||||
scene_dir = version_up(
|
||||
|
|
|
|||
29
pype/plugins/photoshop/publish/increment_workfile.py
Normal file
29
pype/plugins/photoshop/publish/increment_workfile.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import pyblish.api
|
||||
from pype.action import get_errored_plugins_from_data
|
||||
from pype.lib import version_up
|
||||
from avalon import photoshop
|
||||
|
||||
|
||||
class IncrementWorkfile(pyblish.api.InstancePlugin):
|
||||
"""Increment the current workfile.
|
||||
|
||||
Saves the current scene with an increased version number.
|
||||
"""
|
||||
|
||||
label = "Increment Workfile"
|
||||
order = pyblish.api.IntegratorOrder + 9.0
|
||||
hosts = ["photoshop"]
|
||||
families = ["workfile"]
|
||||
optional = True
|
||||
|
||||
def process(self, instance):
|
||||
errored_plugins = get_errored_plugins_from_data(instance.context)
|
||||
if errored_plugins:
|
||||
raise RuntimeError(
|
||||
"Skipping incrementing current file because publishing failed."
|
||||
)
|
||||
|
||||
scene_path = version_up(instance.context.data["currentFile"])
|
||||
photoshop.app().ActiveDocument.SaveAs(scene_path)
|
||||
|
||||
self.log.info("Incremented workfile to: {}".format(scene_path))
|
||||
Loading…
Add table
Add a link
Reference in a new issue