Merge pull request #189 from ynput/bugfix/AY-3892_3dsMax-refactor-save-max-file

Max: Always save max scene file before deadline submission
This commit is contained in:
Kayla Man 2024-03-18 10:23:47 +00:00 committed by GitHub
commit 511650ef0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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: