Merge branch 'develop' into enhancement/AY-1228_Load-plugins-update

This commit is contained in:
Jakub Trllo 2024-03-18 13:59:40 +01:00
commit c4ddfe7a89
2 changed files with 7 additions and 5 deletions

View file

@ -9,7 +9,7 @@ class IncrementWorkfileVersion(pyblish.api.ContextPlugin):
order = pyblish.api.IntegratorOrder + 0.9
label = "Increment Workfile Version"
hosts = ["max"]
families = ["workfile"]
families = ["maxrender", "workfile"]
def process(self, context):
path = context.data["currentFile"]

View file

@ -2,7 +2,7 @@ import pyblish.api
from ayon_core.pipeline import registered_host
class SaveCurrentScene(pyblish.api.ContextPlugin):
class SaveCurrentScene(pyblish.api.InstancePlugin):
"""Save current scene"""
label = "Save current file"
@ -10,13 +10,15 @@ class SaveCurrentScene(pyblish.api.ContextPlugin):
hosts = ["max"]
families = ["maxrender", "workfile"]
def process(self, context):
def process(self, instance):
host = registered_host()
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}")
host.save_workfile(current_file)
else: