Hi, you have to add your function to manage the ask and save process. Not just like 3 line i wrote...
Something like this
from PySide6 import QtWidgets
from PySide6.QtWidgets import QMessageBox, QFileDialog
def myCreateNewScene():
if vrScenegraphService.isSceneEmpty():
vrFileIOService.newFile()
else:
msgBox = QMessageBox(QMessageBox.Question, "Save", "Save Changet You your Scene?", QMessageBox.Yes|QMessageBox.No|QMessageBox.Cancel, None)
retVal = msgBox.exec()
if retVal == 16384:
curFileName = vrFileIOService.getFileName()
if not curFileName or len(curFileName) == 0:
curFileNameSel = QFileDialog.getSaveFileName(None, "Create a new Vred File...", "", "Vred vpb Files (*.vpb)")
if curFileNameSel and len(curFileNameSel):
curFileName = curFileNameSel[0]
if curFileName and len(curFileName):
vrFileIOService.saveFile(curFileName)
vrFileIOService.newFile()
elif retVal == 65536:
vrFileIOService.newFile()
else:
print("New Scene Aborted.")
keyNSc = vrKey(Key_N, ControlButton)
keyNSc.connect("myCreateNewScene()")
keyNSc.setDescription("Create New Scene")
Try it before.....
Best
Chris