mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Increment workfile plugin
This commit is contained in:
parent
c9d90c1c3c
commit
18184a321b
1 changed files with 22 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
import pyblish.api
|
||||
|
||||
from avalon.tvpaint import workio
|
||||
from openpype.api import version_up
|
||||
|
||||
|
||||
class IncrementWorkfileVersion(pyblish.api.ContextPlugin):
|
||||
"""Increment current workfile version."""
|
||||
|
||||
order = pyblish.api.IntegratorOrder + 1
|
||||
label = "Increment Workfile Version"
|
||||
optional = True
|
||||
hosts = ["tvpaint"]
|
||||
|
||||
def process(self, context):
|
||||
|
||||
assert all(result["success"] for result in context.data["results"]), (
|
||||
"Publishing not succesfull so version is not increased.")
|
||||
|
||||
path = context.data["currentFile"]
|
||||
workio.save_file(version_up(path))
|
||||
self.log.info('Incrementing workfile version')
|
||||
Loading…
Add table
Add a link
Reference in a new issue