diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index bb3385c874..815f6b5f3c 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -186,6 +186,11 @@ StackView { anchors.leftMargin: 55 anchors.top: assetServerButton.bottom anchors.topMargin: 20 + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "importEntitiesButton" } + }); + } } } } diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 55bd11b286..ecf8167e43 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -294,7 +294,21 @@ var toolBar = (function () { that.toggle(); }); - addButton("openAssetBrowserButton", "assets-01.svg", function(){ + addButton("importEntitiesButton", "assets-01.svg", function() { + var importURL = null; + var fullPath = Window.browse("Select Model to Import", "", "*.json"); + if (fullPath) { + importURL = "file:///" + fullPath; + } + if (importURL) { + if (!isActive && (Entities.canRez() && Entities.canRezTmp())) { + toolBar.toggle(); + } + importSVO(importURL); + } + }); + + addButton("openAssetBrowserButton", "assets-01.svg", function() { Window.showAssetServer(); });