mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
make sure the scene file would be saved and increment before deadline submission
This commit is contained in:
parent
89701454c3
commit
0f71a89f88
2 changed files with 7 additions and 5 deletions
|
|
@ -9,7 +9,7 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin):
|
||||||
order = pyblish.api.IntegratorOrder + 0.9
|
order = pyblish.api.IntegratorOrder + 0.9
|
||||||
label = "Increment Workfile Version"
|
label = "Increment Workfile Version"
|
||||||
hosts = ["max"]
|
hosts = ["max"]
|
||||||
families = ["workfile"]
|
families = ["maxrender", "workfile"]
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, context):
|
||||||
path = context.data["currentFile"]
|
path = context.data["currentFile"]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import pyblish.api
|
||||||
from ayon_core.pipeline import registered_host
|
from ayon_core.pipeline import registered_host
|
||||||
|
|
||||||
|
|
||||||
class SaveCurrentScene(pyblish.api.ContextPlugin):
|
class SaveCurrentScene(pyblish.api.InstancePlugin):
|
||||||
"""Save current scene"""
|
"""Save current scene"""
|
||||||
|
|
||||||
label = "Save current file"
|
label = "Save current file"
|
||||||
|
|
@ -10,13 +10,15 @@ class SaveCurrentScene(pyblish.api.ContextPlugin):
|
||||||
hosts = ["max"]
|
hosts = ["max"]
|
||||||
families = ["maxrender", "workfile"]
|
families = ["maxrender", "workfile"]
|
||||||
|
|
||||||
def process(self, context):
|
def process(self, instance):
|
||||||
host = registered_host()
|
host = registered_host()
|
||||||
current_file = host.get_current_workfile()
|
current_file = host.get_current_workfile()
|
||||||
|
|
||||||
assert context.data["currentFile"] == current_file
|
assert instance.context.data["currentFile"] == current_file
|
||||||
|
if instance.data["productType"] == "maxrender":
|
||||||
|
host.save_workfile(current_file)
|
||||||
|
|
||||||
if host.workfile_has_unsaved_changes():
|
elif host.workfile_has_unsaved_changes():
|
||||||
self.log.info(f"Saving current file: {current_file}")
|
self.log.info(f"Saving current file: {current_file}")
|
||||||
host.save_workfile(current_file)
|
host.save_workfile(current_file)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue