From 61dc31ffe76fafea99fa20177311bd256910ab98 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 23 Mar 2015 14:09:45 -0700 Subject: [PATCH 1/4] Update export entities to export as JSON --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4ff41e1b6f..840e8388c7 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1751,7 +1751,7 @@ bool Application::exportEntities(const QString& filename, const QVectorgetEntityItemID(), properties); } - exportTree.writeToSVOFile(filename.toLocal8Bit().constData()); + exportTree.writeToJSONFile(filename.toLocal8Bit().constData()); // restore the main window's active state _window->activateWindow(); From 6d932508ffbe66ddd9e2fe1066868f3d0e0b1e96 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 24 Mar 2015 10:27:53 -0700 Subject: [PATCH 2/4] Add support for .svo.json extension --- interface/src/Application.h | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.h b/interface/src/Application.h index 4038b21739..6e0c3cebd2 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -95,6 +95,7 @@ static const float NODE_KILLED_BLUE = 0.0f; static const QString SNAPSHOT_EXTENSION = ".jpg"; static const QString SVO_EXTENSION = ".svo"; +static const QString SVO_JSON_EXTENSION = ".svo.json"; static const QString JS_EXTENSION = ".js"; static const QString FST_EXTENSION = ".fst"; From a901bc4b11ba199879cafa6b766012b44deab33f Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 24 Mar 2015 10:28:12 -0700 Subject: [PATCH 3/4] Update edit.js to export as .svo.json --- examples/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/edit.js b/examples/edit.js index 72938e5ed4..2179fe5342 100644 --- a/examples/edit.js +++ b/examples/edit.js @@ -910,8 +910,8 @@ function handeMenuEvent(menuItem) { if (!selectionManager.hasSelection()) { Window.alert("No entities have been selected."); } else { - var filename = "models__" + Window.location.hostname + "__.svo"; - filename = Window.save("Select where to save", filename, "*.svo") + var filename = "entities__" + Window.location.hostname + ".svo.json"; + filename = Window.save("Select where to save", filename, "*.json") if (filename) { var success = Clipboard.exportEntities(filename, selectionManager.selections); if (!success) { @@ -923,7 +923,7 @@ function handeMenuEvent(menuItem) { var importURL; if (menuItem == "Import Entities") { - importURL = Window.browse("Select models to import", "", "*.svo"); + importURL = Window.browse("Select models to import", "", "*.json"); } else { importURL = Window.prompt("URL of SVO to import", ""); } From 2fc0ef80d0eb4b42521355b058d04e880c0378aa Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 24 Mar 2015 10:40:46 -0700 Subject: [PATCH 4/4] Add SVO_JSON_EXTENSION to accepted extensions --- interface/src/Application.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 840e8388c7..cf9d583945 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3599,6 +3599,7 @@ void Application::initializeAcceptedFiles() { if (_acceptedExtensions.size() == 0) { _acceptedExtensions[SNAPSHOT_EXTENSION] = &Application::acceptSnapshot; _acceptedExtensions[SVO_EXTENSION] = &Application::importSVOFromURL; + _acceptedExtensions[SVO_JSON_EXTENSION] = &Application::importSVOFromURL; _acceptedExtensions[JS_EXTENSION] = &Application::askToLoadScript; _acceptedExtensions[FST_EXTENSION] = &Application::askToSetAvatarUrl; }