diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp index deb75ff78c..b20fcb7e7a 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/MainWindow.cpp @@ -1764,7 +1764,7 @@ namespace ScriptCanvasEditor AZStd::string suggestedFilename; AZStd::string suggestedFileFilter; bool isValidFileName = false; - + if (save == Save::InPlace) { isValidFileName = true; @@ -1773,7 +1773,17 @@ namespace ScriptCanvasEditor } else { - GetSuggestedFullFilenameToSaveAs(inMemoryAssetId, suggestedFilename, suggestedFileFilter); + // replaces GetSuggestedFullFilenameToSaveAs + suggestedFileFilter = ScriptCanvasAssetDescription().GetExtensionImpl(); + + if (inMemoryAssetId.Path().empty()) + { + suggestedFilename = ScriptCanvasAssetDescription().GetSuggestedSavePathImpl(); + } + else + { + suggestedFilename = inMemoryAssetId.Path(); + } } EnsureSaveDestinationDirectory(suggestedFilename); @@ -1788,7 +1798,14 @@ namespace ScriptCanvasEditor // So we want to break out. if (!selectedFile.isEmpty()) { + ScriptCanvasAssetDescription assetDescription; AZStd::string filePath = selectedFile.toUtf8().data(); + + if (!AZ::StringFunc::EndsWith(filePath, assetDescription.GetExtensionImpl(), false)) + { + filePath += assetDescription.GetExtensionImpl(); + } + AZStd::string fileName; // Verify that the path is within the project