Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for comment in "create new version from current" #5

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Prism/Scripts/PrismCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def checkAutoSave(self):
def autoSaveDone(self, action=2):
saved = False
if action == 0:
saved = self.saveScene(prismReq=False)
saved = self.saveScene(prismReq=False, versionUp=False)
elif action == 1:
saved = self.saveScene()
elif action == 3:
Expand Down
25 changes: 23 additions & 2 deletions Prism/Scripts/ProjectScripts/ProjectBrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,26 +1276,47 @@ def exeFile(self, index=None, filepath=""):
if self.core.getCurrentFileName().replace("\\","/") == filepath and self.actionCloseAfterLoad.isChecked():
self.close()

@err_decorator
def commentDialog(self):
try:
del sys.modules["SaveComment"]
except:
pass
try:
import SaveComment
except:
modPath = imp.find_module("SaveComment")[1]
if modPath.endswith(".pyc") and os.path.exists(modPath[:-1]):
os.remove(modPath)
import SaveComment
savec = SaveComment.SaveComment(core = self.core)
savec.exec_()
return savec.e_comment.text()


@err_decorator
def createFromCurrent(self):

fname = self.core.getCurrentFileName()
comment = self.commentDialog()
if comment == "" or comment is None:
comment = "nocomment"
if self.tbw_browser.tabText(self.tbw_browser.currentIndex()) == "Assets":
dstname = self.tw_aHierarchy.currentItem().text(1)
refresh = self.refreshAFile

prefix = self.tw_aHierarchy.currentItem().text(0)
step = self.lw_aPipeline.currentItem().text()
dstname = os.path.join(dstname, "Scenefiles", step)
newfname = prefix + self.core.filenameSeperator + step + self.core.filenameSeperator + self.core.getHighestVersion(dstname, "Asset") + self.core.filenameSeperator + "nocomment" + self.core.filenameSeperator + self.core.user
newfname = prefix + self.core.filenameSeperator + step + self.core.filenameSeperator + self.core.getHighestVersion(dstname, "Asset") + self.core.filenameSeperator + comment + self.core.filenameSeperator + self.core.user

elif self.tbw_browser.tabText(self.tbw_browser.currentIndex()) == "Shots":
dstname = os.path.join(self.sBasePath, self.cursShots, "Scenefiles", self.cursStep, self.cursCat)
refresh = self.refreshSFile

subcat = self.core.filenameSeperator + self.cursCat
newfname = "shot" + self.core.filenameSeperator + self.cursShots + self.core.filenameSeperator + self.cursStep + subcat + self.core.filenameSeperator + self.core.getHighestVersion(dstname, "Shot") + self.core.filenameSeperator + "nocomment" + self.core.filenameSeperator + self.core.user
newfname = "shot" + self.core.filenameSeperator + self.cursShots + self.core.filenameSeperator + self.cursStep + subcat + self.core.filenameSeperator + self.core.getHighestVersion(dstname, "Shot") + self.core.filenameSeperator + comment + self.core.filenameSeperator + self.core.user


if "newfname" in locals():
filepath = os.path.join(dstname, newfname)
Expand Down