diff --git a/interface/resources/qml/hifi/tablet/NewModelDialog.qml b/interface/resources/qml/hifi/tablet/NewModelDialog.qml index 10b844c987..553a4fd59f 100644 --- a/interface/resources/qml/hifi/tablet/NewModelDialog.qml +++ b/interface/resources/qml/hifi/tablet/NewModelDialog.qml @@ -116,9 +116,14 @@ Rectangle { Column { id: column2 width: 200 - height: 400 + height: 600 spacing: 10 + CheckBox { + id: grabbable + text: qsTr("Grabbable") + } + CheckBox { id: dynamic text: qsTr("Dynamic") @@ -217,9 +222,10 @@ Rectangle { newModelDialog.sendToScript({ method: "newModelDialogAdd", params: { - textInput: modelURL.text, - checkBox: dynamic.checked, - comboBox: collisionType.currentIndex + url: modelURL.text, + dynamic: dynamic.checked, + collisionShapeIndex: collisionType.currentIndex, + grabbable: grabbable.checked } }); } diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 686a516504..1720cb8278 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -348,12 +348,12 @@ var toolBar = (function () { if (!properties.grab) { properties.grab = {}; - } - if (Menu.isOptionChecked(MENU_CREATE_ENTITIES_GRABBABLE) && - !(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) { - properties.grab.grabbable = true; - } else { - properties.grab.grabbable = false; + if (Menu.isOptionChecked(MENU_CREATE_ENTITIES_GRABBABLE) && + !(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) { + properties.grab.grabbable = true; + } else { + properties.grab.grabbable = false; + } } SelectionManager.saveProperties(); @@ -442,9 +442,9 @@ var toolBar = (function () { function handleNewModelDialogResult(result) { if (result) { - var url = result.textInput; + var url = result.url; var shapeType; - switch (result.comboBox) { + switch (result.collisionShapeIndex) { case SHAPE_TYPE_SIMPLE_HULL: shapeType = "simple-hull"; break; @@ -464,7 +464,7 @@ var toolBar = (function () { shapeType = "none"; } - var dynamic = result.checkBox !== null ? result.checkBox : DYNAMIC_DEFAULT; + var dynamic = result.dynamic !== null ? result.dynamic : DYNAMIC_DEFAULT; if (shapeType === "static-mesh" && dynamic) { // The prompt should prevent this case print("Error: model cannot be both static mesh and dynamic. This should never happen."); @@ -473,6 +473,9 @@ var toolBar = (function () { type: "Model", modelURL: url, shapeType: shapeType, + grab: { + grabbable: result.grabbable + }, dynamic: dynamic, gravity: dynamic ? { x: 0, y: -10, z: 0 } : { x: 0, y: 0, z: 0 } });