mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
move the workfile version collector into general publish plugins
This commit is contained in:
parent
b55ead017a
commit
dd99516853
1 changed files with 5 additions and 5 deletions
19
client/ayon_core/plugins/publish/collect_workfile_version.py
Normal file
19
client/ayon_core/plugins/publish/collect_workfile_version.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import pyblish.api
|
||||
|
||||
from ayon_core.pipeline import registered_host
|
||||
from ayon_core.lib import get_version_from_path
|
||||
|
||||
|
||||
class CollectWorkfileVersion(pyblish.api.ContextPlugin):
|
||||
"""Collect current workfile version as context data"""
|
||||
|
||||
order = pyblish.api.CollectorOrder - 0.5
|
||||
label = "Current Workfile Version"
|
||||
|
||||
def process(self, context):
|
||||
host = registered_host()
|
||||
path = host.get_current_workfile()
|
||||
if path:
|
||||
version = int(get_version_from_path(path))
|
||||
context.data["version"] = version
|
||||
self.log.debug(f"Current Version: {version}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue