From e50c4380f4651cdcce6fefe82a457769b9af1bc9 Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Mon, 8 Apr 2019 17:27:08 +0200 Subject: [PATCH] keep extension in maya when versioning up --- .../maya/publish/increment_current_file_deadline.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pype/plugins/maya/publish/increment_current_file_deadline.py b/pype/plugins/maya/publish/increment_current_file_deadline.py index 527f3d781d..6f644adacb 100644 --- a/pype/plugins/maya/publish/increment_current_file_deadline.py +++ b/pype/plugins/maya/publish/increment_current_file_deadline.py @@ -31,10 +31,11 @@ class IncrementCurrentFileDeadline(pyblish.api.ContextPlugin): current_filepath = context.data["currentFile"] new_filepath = version_up(current_filepath) - # Ensure the suffix is .ma because we're saving to `mayaAscii` type - if not new_filepath.endswith(".ma"): - self.log.warning("Refactoring scene to .ma extension") - new_filepath = os.path.splitext(new_filepath)[0] + ".ma" + # # Ensure the suffix is .ma because we're saving to `mayaAscii` type + if new_filepath.endswith(".ma"): + fileType = "mayaAscii" + elif new_filepath.endswith(".mb"): + fileType = "mayaBinary" cmds.file(rename=new_filepath) - cmds.file(save=True, force=True, type="mayaAscii") + cmds.file(save=True, force=True, type=fileType)