From 8cf60df5b060e9cfd04ea1abd903be4f1381ddf5 Mon Sep 17 00:00:00 2001 From: "rick@ghostpunch.com" Date: Tue, 11 Jul 2017 18:24:19 -0400 Subject: [PATCH 1/6] Address #21402 Added a handler to Sit.js script for the onLoadComplete signal to which re-applys the siting animation rol overrides. This works around a bug that shows up if the user switches avatars while the current avatar has overloaded anim roles. --- scripts/tutorials/entity_scripts/sit.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index 3d3bc10fb1..a532195041 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -122,10 +122,21 @@ this.rolesToOverride = function() { return MyAvatar.getAnimationRoles().filter(function(role) { - return role === "fly" || role.startsWith("inAir"); + return role === "right" || role.startsWith("left"); }); } + // Handler for user changing the avatar model while sitting. There's currently an issue with changing avatar models while override role animations are applied, + // so to avoid that problem, re-apply the role overrides once the model has finished changing. + this.modelURLChangeFinished = function () { + print("Sitter's model has FINISHED changing. Reapply anim role overrides."); + var roles = this.rolesToOverride(); + for (i in roles) { + //print("Overriding role animation " + roles[i]); + MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME); + } + } + this.sitDown = function() { if (this.checkSeatForAvatar()) { print("Someone is already sitting in that chair."); @@ -164,12 +175,14 @@ return { headType: 0 }; }, ["headType"]); Script.update.connect(this, this.update); + MyAvatar.onLoadComplete.connect(this, this.modelURLChangeFinished); } this.standUp = function() { print("Standing up (" + this.entityID + ")"); MyAvatar.removeAnimationStateHandler(this.animStateHandlerID); Script.update.disconnect(this, this.update); + MyAvatar.onLoadComplete.disconnect(this, this.modelURLChangeFinished); if (MyAvatar.sessionUUID === this.getSeatUser()) { this.setSeatUser(null); From ce5ff23e7082b6afbe5652a093473c45816e3311 Mon Sep 17 00:00:00 2001 From: utkarshgautamnyu Date: Wed, 19 Jul 2017 16:15:34 -0700 Subject: [PATCH 2/6] made changes to size of content to dosplay 'choose file' button --- interface/resources/qml/hifi/dialogs/TabletAssetServer.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml index 47c9af1f57..0256805422 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml @@ -506,7 +506,7 @@ Rectangle { } HifiControls.Tree { id: treeView - height: 430 + height: 290 anchors.leftMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border anchors.rightMargin: hifi.dimensions.contentMargin.x + 2 // Extra for border anchors.left: parent.left From 3805228b70635e4c18332fd1f941bffb8d6539a5 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 20 Jul 2017 16:26:51 +0100 Subject: [PATCH 3/6] fixed grab the tablet in third person --- scripts/system/controllers/handControllerGrab.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/system/controllers/handControllerGrab.js b/scripts/system/controllers/handControllerGrab.js index e2de13d4b1..6b671d366f 100644 --- a/scripts/system/controllers/handControllerGrab.js +++ b/scripts/system/controllers/handControllerGrab.js @@ -1034,9 +1034,18 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp) { function getControllerJointIndex(hand) { if (HMD.isHandControllerAvailable()) { - return MyAvatar.getJointIndex(hand === RIGHT_HAND ? - "_CONTROLLER_RIGHTHAND" : - "_CONTROLLER_LEFTHAND"); + var controllerJointIndex = -1; + if (Camera.mode === "first person") { + controllerJointIndex = MyAvatar.getJointIndex(hand === RIGHT_HAND ? + "_CONTROLLER_RIGHTHAND" : + "_CONTROLLER_LEFTHAND"); + } else if (Camera.mode === "third person") { + controllerJointIndex = MyAvatar.getJointIndex(hand === RIGHT_HAND ? + "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" : + "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND"); + } + + return controllerJointIndex; } return MyAvatar.getJointIndex("Head"); From cc0ed9ead49b48ccae2e741b9719700e16c38d11 Mon Sep 17 00:00:00 2001 From: "rick@ghostpunch.com" Date: Thu, 20 Jul 2017 15:26:12 -0400 Subject: [PATCH 4/6] Corrected typo in role name search filter. Removed commented out debug print --- scripts/tutorials/entity_scripts/sit.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index a532195041..145188380e 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -122,7 +122,7 @@ this.rolesToOverride = function() { return MyAvatar.getAnimationRoles().filter(function(role) { - return role === "right" || role.startsWith("left"); + return !(role === "right" && role.startsWith("left")); }); } @@ -132,7 +132,6 @@ print("Sitter's model has FINISHED changing. Reapply anim role overrides."); var roles = this.rolesToOverride(); for (i in roles) { - //print("Overriding role animation " + roles[i]); MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME); } } From 2b9da2bcba83cb168e28b63992c105e3d81f2171 Mon Sep 17 00:00:00 2001 From: "rick@ghostpunch.com" Date: Thu, 20 Jul 2017 15:44:59 -0400 Subject: [PATCH 5/6] Fix another typo. Sigh... --- scripts/tutorials/entity_scripts/sit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index 145188380e..716a5a177f 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -122,7 +122,7 @@ this.rolesToOverride = function() { return MyAvatar.getAnimationRoles().filter(function(role) { - return !(role === "right" && role.startsWith("left")); + return !(role === "right" || role.startsWith("left")); }); } From 451b7ec1def2d418eaa539121bfaf45fb39bb666 Mon Sep 17 00:00:00 2001 From: "rick@ghostpunch.com" Date: Thu, 20 Jul 2017 17:01:02 -0400 Subject: [PATCH 6/6] Revert the role name filter change as it has already been added to the repo --- scripts/tutorials/entity_scripts/sit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index 716a5a177f..93e765910b 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -122,7 +122,7 @@ this.rolesToOverride = function() { return MyAvatar.getAnimationRoles().filter(function(role) { - return !(role === "right" || role.startsWith("left")); + return role === "fly" || role.startsWith("inAir"); }); }