diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index f8f728f834..5f99dd68bc 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -324,16 +324,8 @@ void EntityScriptServer::nodeActivated(SharedNodePointer activatedNode) { void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { switch (killedNode->getType()) { case NodeType::EntityServer: { - if (!_shuttingDown) { - if (_entitiesScriptEngine) { - _entitiesScriptEngine->unloadAllEntityScripts(); - _entitiesScriptEngine->stop(); - } - - resetEntitiesScriptEngine(); - - _entityViewer.clear(); - } + clear(); + break; } case NodeType::Agent: { @@ -440,12 +432,12 @@ void EntityScriptServer::clear() { _entitiesScriptEngine->stop(); } + _entityViewer.clear(); + // reset the engine if (!_shuttingDown) { resetEntitiesScriptEngine(); } - - _entityViewer.clear(); } void EntityScriptServer::shutdownScriptEngine() { diff --git a/domain-server/resources/web/settings/js/settings.js b/domain-server/resources/web/settings/js/settings.js index c5f055bed0..7642a66867 100644 --- a/domain-server/resources/web/settings/js/settings.js +++ b/domain-server/resources/web/settings/js/settings.js @@ -996,6 +996,10 @@ function saveSettings() { if (password && password.length > 0) { formJSON["security"]["http_password"] = sha256_digest(password); } + var verify_password = formJSON["security"]["verify_http_password"]; + if (verify_password && verify_password.length > 0) { + formJSON["security"]["verify_http_password"] = sha256_digest(verify_password); + } } // verify that the password and confirmation match before saving @@ -1010,7 +1014,6 @@ function saveSettings() { bootbox.alert({"message": "Passwords must match!", "title":"Password Error"}); canPost = false; } else { - formJSON["security"]["http_password"] = sha256_digest(password); delete formJSON["security"]["verify_http_password"]; } } diff --git a/interface/resources/avatar/animations/touch_point_closed_left.fbx b/interface/resources/avatar/animations/touch_point_closed_left.fbx new file mode 100644 index 0000000000..8835de4f7f Binary files /dev/null and b/interface/resources/avatar/animations/touch_point_closed_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_point_closed_right.fbx b/interface/resources/avatar/animations/touch_point_closed_right.fbx new file mode 100644 index 0000000000..c4efe4ff90 Binary files /dev/null and b/interface/resources/avatar/animations/touch_point_closed_right.fbx differ diff --git a/interface/resources/avatar/animations/touch_point_open_left.fbx b/interface/resources/avatar/animations/touch_point_open_left.fbx new file mode 100644 index 0000000000..cbab6cd55d Binary files /dev/null and b/interface/resources/avatar/animations/touch_point_open_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_point_open_right.fbx b/interface/resources/avatar/animations/touch_point_open_right.fbx new file mode 100644 index 0000000000..b54abe2b2e Binary files /dev/null and b/interface/resources/avatar/animations/touch_point_open_right.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_closed_left.fbx b/interface/resources/avatar/animations/touch_thumb_closed_left.fbx new file mode 100644 index 0000000000..5a731144ba Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_closed_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_closed_right.fbx b/interface/resources/avatar/animations/touch_thumb_closed_right.fbx new file mode 100644 index 0000000000..d947cdb1fd Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_closed_right.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_open_left.fbx b/interface/resources/avatar/animations/touch_thumb_open_left.fbx new file mode 100644 index 0000000000..b50cbd8541 Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_open_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_open_right.fbx b/interface/resources/avatar/animations/touch_thumb_open_right.fbx new file mode 100644 index 0000000000..ca861d0250 Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_open_right.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_point_closed_left.fbx b/interface/resources/avatar/animations/touch_thumb_point_closed_left.fbx new file mode 100644 index 0000000000..bf8023b54a Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_point_closed_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_point_closed_right.fbx b/interface/resources/avatar/animations/touch_thumb_point_closed_right.fbx new file mode 100644 index 0000000000..46c0cd48c4 Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_point_closed_right.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_point_open_left.fbx b/interface/resources/avatar/animations/touch_thumb_point_open_left.fbx new file mode 100644 index 0000000000..23c36f2172 Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_point_open_left.fbx differ diff --git a/interface/resources/avatar/animations/touch_thumb_point_open_right.fbx b/interface/resources/avatar/animations/touch_thumb_point_open_right.fbx new file mode 100644 index 0000000000..5016832aab Binary files /dev/null and b/interface/resources/avatar/animations/touch_thumb_point_open_right.fbx differ diff --git a/interface/resources/avatar/avatar-animation.json b/interface/resources/avatar/avatar-animation.json index 834a3fc277..975f01855d 100644 --- a/interface/resources/avatar/avatar-animation.json +++ b/interface/resources/avatar/avatar-animation.json @@ -128,7 +128,41 @@ "id": "rightHandGrasp", "interpTarget": 3, "interpDuration": 3, - "transitions": [] + "transitions": [ + { "var": "isRightIndexPoint", "state": "rightIndexPoint" }, + { "var": "isRightThumbRaise", "state": "rightThumbRaise" }, + { "var": "isRightIndexPointAndThumbRaise", "state": "rightIndexPointAndThumbRaise" } + ] + }, + { + "id": "rightIndexPoint", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isRightHandGrasp", "state": "rightHandGrasp" }, + { "var": "isRightThumbRaise", "state": "rightThumbRaise" }, + { "var": "isRightIndexPointAndThumbRaise", "state": "rightIndexPointAndThumbRaise" } + ] + }, + { + "id": "rightThumbRaise", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isRightHandGrasp", "state": "rightHandGrasp" }, + { "var": "isRightIndexPoint", "state": "rightIndexPoint" }, + { "var": "isRightIndexPointAndThumbRaise", "state": "rightIndexPointAndThumbRaise" } + ] + }, + { + "id": "rightIndexPointAndThumbRaise", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isRightHandGrasp", "state": "rightHandGrasp" }, + { "var": "isRightIndexPoint", "state": "rightIndexPoint" }, + { "var": "isRightThumbRaise", "state": "rightThumbRaise" } + ] } ] }, @@ -166,6 +200,108 @@ "children": [] } ] + }, + { + "id": "rightIndexPoint", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "rightHandGraspAlpha" + }, + "children": [ + { + "id": "rightIndexPointOpen", + "type": "clip", + "data": { + "url": "animations/touch_point_open_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "rightIndexPointClosed", + "type": "clip", + "data": { + "url": "animations/touch_point_closed_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] + }, + { + "id": "rightThumbRaise", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "rightHandGraspAlpha" + }, + "children": [ + { + "id": "rightThumbRaiseOpen", + "type": "clip", + "data": { + "url": "animations/touch_thumb_open_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "rightThumbRaiseClosed", + "type": "clip", + "data": { + "url": "animations/touch_thumb_closed_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] + }, + { + "id": "rightIndexPointAndThumbRaise", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "rightHandGraspAlpha" + }, + "children": [ + { + "id": "rightIndexPointAndThumbRaiseOpen", + "type": "clip", + "data": { + "url": "animations/touch_thumb_point_open_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "rightIndexPointAndThumbRaiseClosed", + "type": "clip", + "data": { + "url": "animations/touch_thumb_point_closed_right.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] } ] }, @@ -175,7 +311,7 @@ "data": { "alpha": 0.0, "boneSet": "leftHand", - "alphaVar" : "leftHandOverlayAlpha" + "alphaVar": "leftHandOverlayAlpha" }, "children": [ { @@ -188,7 +324,41 @@ "id": "leftHandGrasp", "interpTarget": 3, "interpDuration": 3, - "transitions": [] + "transitions": [ + { "var": "isLeftIndexPoint", "state": "leftIndexPoint" }, + { "var": "isLeftThumbRaise", "state": "leftThumbRaise" }, + { "var": "isLeftIndexPointAndThumbRaise", "state": "leftIndexPointAndThumbRaise" } + ] + }, + { + "id": "leftIndexPoint", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isLeftHandGrasp", "state": "leftHandGrasp" }, + { "var": "isLeftThumbRaise", "state": "leftThumbRaise" }, + { "var": "isLeftIndexPointAndThumbRaise", "state": "leftIndexPointAndThumbRaise" } + ] + }, + { + "id": "leftThumbRaise", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isLeftHandGrasp", "state": "leftHandGrasp" }, + { "var": "isLeftIndexPoint", "state": "leftIndexPoint" }, + { "var": "isLeftIndexPointAndThumbRaise", "state": "leftIndexPointAndThumbRaise" } + ] + }, + { + "id": "leftIndexPointAndThumbRaise", + "interpTarget": 15, + "interpDuration": 3, + "transitions": [ + { "var": "isLeftHandGrasp", "state": "leftHandGrasp" }, + { "var": "isLeftIndexPoint", "state": "leftIndexPoint" }, + { "var": "isLeftThumbRaise", "state": "leftThumbRaise" } + ] } ] }, @@ -226,6 +396,108 @@ "children": [] } ] + }, + { + "id": "leftIndexPoint", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "leftHandGraspAlpha" + }, + "children": [ + { + "id": "leftIndexPointOpen", + "type": "clip", + "data": { + "url": "animations/touch_point_open_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "leftIndexPointClosed", + "type": "clip", + "data": { + "url": "animations/touch_point_closed_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] + }, + { + "id": "leftThumbRaise", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "leftHandGraspAlpha" + }, + "children": [ + { + "id": "leftThumbRaiseOpen", + "type": "clip", + "data": { + "url": "animations/touch_thumb_open_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "leftThumbRaiseClosed", + "type": "clip", + "data": { + "url": "animations/touch_thumb_closed_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] + }, + { + "id": "leftIndexPointAndThumbRaise", + "type": "blendLinear", + "data": { + "alpha": 0.0, + "alphaVar": "leftHandGraspAlpha" + }, + "children": [ + { + "id": "leftIndexPointAndThumbRaiseOpen", + "type": "clip", + "data": { + "url": "animations/touch_thumb_point_open_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + }, + { + "id": "leftIndexPointAndThumbRaiseClosed", + "type": "clip", + "data": { + "url": "animations/touch_thumb_point_closed_left.fbx", + "startFrame": 15.0, + "endFrame": 15.0, + "timeScale": 1.0, + "loopFlag": true + }, + "children": [] + } + ] } ] }, diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 03241e601b..e1b06e8ff0 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1223,6 +1223,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo if (entity && entity->wantsKeyboardFocus()) { setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID); setKeyboardFocusEntity(entityItemID); + } else { + setKeyboardFocusEntity(UNKNOWN_ENTITY_ID); } }); diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 40a77eda55..5d8813e988 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -20,7 +20,7 @@ var DEFAULT_SCRIPTS = [ "system/bubble.js", "system/snapshot.js", "system/help.js", - "system/pal.js", //"system/mod.js", // older UX, if you prefer + "system/pal.js", // "system/mod.js", // older UX, if you prefer "system/goto.js", "system/marketplaces/marketplaces.js", "system/edit.js", @@ -54,9 +54,6 @@ if (previousSetting === true || previousSetting === 'true') { previousSetting = true; } - - - if (Menu.menuExists(MENU_CATEGORY) && !Menu.menuItemExists(MENU_CATEGORY, MENU_ITEM)) { Menu.addMenuItem({ menuName: MENU_CATEGORY, @@ -78,11 +75,11 @@ function runDefaultsSeparately() { Script.load(DEFAULT_SCRIPTS[i]); } } + // start all scripts if (Menu.isOptionChecked(MENU_ITEM)) { // we're debugging individual default scripts // so we load each into its own ScriptEngine instance - debuggingDefaultScripts = true; runDefaultsSeparately(); } else { // include all default scripts into this ScriptEngine @@ -90,32 +87,14 @@ if (Menu.isOptionChecked(MENU_ITEM)) { } function menuItemEvent(menuItem) { - if (menuItem == MENU_ITEM) { - - isChecked = Menu.isOptionChecked(MENU_ITEM); + if (menuItem === MENU_ITEM) { + var isChecked = Menu.isOptionChecked(MENU_ITEM); if (isChecked === true) { Settings.setValue(SETTINGS_KEY, true); } else if (isChecked === false) { Settings.setValue(SETTINGS_KEY, false); } - Window.alert('You must reload all scripts for this to take effect.') - } - - -} - - - -function stopLoadedScripts() { - // remove debug script loads - var runningScripts = ScriptDiscoveryService.getRunning(); - for (var i in runningScripts) { - var scriptName = runningScripts[i].name; - for (var j in DEFAULT_SCRIPTS) { - if (DEFAULT_SCRIPTS[j].slice(-scriptName.length) === scriptName) { - ScriptDiscoveryService.stopScript(runningScripts[i].url); - } - } + Menu.triggerOption("Reload All Scripts"); } } @@ -126,7 +105,6 @@ function removeMenuItem() { } Script.scriptEnding.connect(function() { - stopLoadedScripts(); removeMenuItem(); }); diff --git a/scripts/system/controllers/squeezeHands.js b/scripts/system/controllers/squeezeHands.js index 3f1d21b46c..75e6249dd6 100644 --- a/scripts/system/controllers/squeezeHands.js +++ b/scripts/system/controllers/squeezeHands.js @@ -25,10 +25,13 @@ var OVERLAY_RAMP_RATE = 8.0; var animStateHandlerID; -var isPointingIndex = false; +var isBothIndexesPointing = false; var HIFI_POINT_INDEX_MESSAGE_CHANNEL = "Hifi-Point-Index"; -var indexfingerJointNames = ["LeftHandIndex1", "LeftHandIndex2", "LeftHandIndex3", "RightHandIndex1", "RightHandIndex2", "RightHandIndex3"]; +var isLeftIndexPointing = false; +var isRightIndexPointing = false; +var isLeftThumbRaised = false; +var isRightThumbRaised = false; function clamp(val, min, max) { return Math.min(Math.max(val, min), max); @@ -46,17 +49,32 @@ function init() { Script.update.connect(update); animStateHandlerID = MyAvatar.addAnimationStateHandler( animStateHandler, - ["leftHandOverlayAlpha", "rightHandOverlayAlpha", "leftHandGraspAlpha", "rightHandGraspAlpha"] + [ + "leftHandOverlayAlpha", "leftHandGraspAlpha", + "rightHandOverlayAlpha", "rightHandGraspAlpha", + "isLeftHandGrasp", "isLeftIndexPoint", "isLeftThumbRaise", "isLeftIndexPointAndThumbRaise", + "isRightHandGrasp", "isRightIndexPoint", "isRightThumbRaise", "isRightIndexPointAndThumbRaise", + ] ); Messages.subscribe(HIFI_POINT_INDEX_MESSAGE_CHANNEL); Messages.messageReceived.connect(handleMessages); } function animStateHandler(props) { - return { leftHandOverlayAlpha: leftHandOverlayAlpha, - leftHandGraspAlpha: lastLeftTrigger, - rightHandOverlayAlpha: rightHandOverlayAlpha, - rightHandGraspAlpha: lastRightTrigger }; + return { + leftHandOverlayAlpha: leftHandOverlayAlpha, + leftHandGraspAlpha: lastLeftTrigger, + rightHandOverlayAlpha: rightHandOverlayAlpha, + rightHandGraspAlpha: lastRightTrigger, + isLeftHandGrasp: !isBothIndexesPointing && !isLeftIndexPointing && !isLeftThumbRaised, + isLeftIndexPoint: (isBothIndexesPointing || isLeftIndexPointing) && !isLeftThumbRaised, + isLeftThumbRaise: !isBothIndexesPointing && !isLeftIndexPointing && isLeftThumbRaised, + isLeftIndexPointAndThumbRaise: (isBothIndexesPointing || isLeftIndexPointing) && isLeftThumbRaised, + isRightHandGrasp: !isBothIndexesPointing && !isRightIndexPointing && !isRightThumbRaised, + isRightIndexPoint: (isBothIndexesPointing || isRightIndexPointing) && !isRightThumbRaised, + isRightThumbRaise: !isBothIndexesPointing && !isRightIndexPointing && isRightThumbRaised, + isRightIndexPointAndThumbRaise: (isBothIndexesPointing || isRightIndexPointing) && isRightThumbRaised + }; } function update(dt) { @@ -84,13 +102,11 @@ function update(dt) { rightHandOverlayAlpha = clamp(rightHandOverlayAlpha - OVERLAY_RAMP_RATE * dt, 0, 1); } - // Point index finger. - if (isPointingIndex) { - var zeroRotation = { x: 0, y: 0, z: 0, w: 1 }; - for (var i = 0; i < indexfingerJointNames.length; i++) { - MyAvatar.setJointRotation(indexfingerJointNames[i], zeroRotation); - } - } + // Pointing index fingers and raising thumbs + isLeftIndexPointing = leftHandPose.valid && Controller.getValue(Controller.Standard.LeftIndexPoint) === 1; + isRightIndexPointing = rightHandPose.valid && Controller.getValue(Controller.Standard.RightIndexPoint) === 1; + isLeftThumbRaised = leftHandPose.valid && Controller.getValue(Controller.Standard.LeftThumbUp) === 1; + isRightThumbRaised = rightHandPose.valid && Controller.getValue(Controller.Standard.RightThumbUp) === 1; } function handleMessages(channel, message, sender) { @@ -98,13 +114,7 @@ function handleMessages(channel, message, sender) { var data = JSON.parse(message); if (data.pointIndex !== undefined) { print("pointIndex: " + data.pointIndex); - isPointingIndex = data.pointIndex; - - if (!isPointingIndex) { - for (var i = 0; i < indexfingerJointNames.length; i++) { - MyAvatar.clearJointData(indexfingerJointNames[i]); - } - } + isBothIndexesPointing = data.pointIndex; } } }