Merge branch 'master' of github.com:highfidelity/hifi into coco

This commit is contained in:
Sam Gateau 2019-05-01 16:04:58 -07:00
commit ad60c51197
3 changed files with 52 additions and 12 deletions

View file

@ -1428,7 +1428,7 @@ int Avatar::getJointIndex(const QString& name) const {
withValidJointIndicesCache([&]() {
if (_modelJointIndicesCache.contains(name)) {
result = _modelJointIndicesCache[name] - 1;
result = _modelJointIndicesCache.value(name) - 1;
}
});
return result;
@ -1439,9 +1439,7 @@ QStringList Avatar::getJointNames() const {
withValidJointIndicesCache([&]() {
// find out how large the vector needs to be
int maxJointIndex = -1;
QHashIterator<QString, int> k(_modelJointIndicesCache);
while (k.hasNext()) {
k.next();
for (auto k = _modelJointIndicesCache.constBegin(); k != _modelJointIndicesCache.constEnd(); k++) {
int index = k.value();
if (index > maxJointIndex) {
maxJointIndex = index;
@ -1450,9 +1448,7 @@ QStringList Avatar::getJointNames() const {
// iterate through the hash and put joint names
// into the vector at their indices
QVector<QString> resultVector(maxJointIndex+1);
QHashIterator<QString, int> i(_modelJointIndicesCache);
while (i.hasNext()) {
i.next();
for (auto i = _modelJointIndicesCache.constBegin(); i != _modelJointIndicesCache.constEnd(); i++) {
int index = i.value();
resultVector[index] = i.key();
}

View file

@ -203,7 +203,7 @@ function setAwayProperties() {
if (!wasMuted) {
Audio.muted = !Audio.muted;
}
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
MyAvatar.setEnableMeshVisible(false); // just for our own display, without changing point of view
playAwayAnimation(); // animation is still seen by others
showOverlay();
@ -223,8 +223,8 @@ function setAwayProperties() {
function setActiveProperties() {
isAway = false;
if (!wasMuted) {
Audio.muted = !Audio.muted;
if (Audio.muted && !wasMuted) {
Audio.muted = false;
}
MyAvatar.setEnableMeshVisible(true); // IWBNI we respected Developer->Avatar->Draw Mesh setting.
stopAwayAnimation();
@ -254,7 +254,7 @@ function setActiveProperties() {
}
function maybeGoActive(event) {
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
if (event.isAutoRepeat) { // isAutoRepeat is true when held down (or when Windows feels like it)
return;
}
if (!isAway && (event.text === 'ESC')) {
@ -314,6 +314,13 @@ function setEnabled(value) {
isEnabled = value;
}
function checkAudioToggled() {
if (isAway && !Audio.muted) {
goActive();
}
}
var CHANNEL_AWAY_ENABLE = "Hifi-Away-Enable";
var handleMessage = function(channel, message, sender) {
if (channel === CHANNEL_AWAY_ENABLE && sender === MyAvatar.sessionUUID) {
@ -324,9 +331,10 @@ var handleMessage = function(channel, message, sender) {
Messages.subscribe(CHANNEL_AWAY_ENABLE);
Messages.messageReceived.connect(handleMessage);
var maybeIntervalTimer = Script.setInterval(function(){
var maybeIntervalTimer = Script.setInterval(function() {
maybeMoveOverlay();
maybeGoAway();
checkAudioToggled();
}, BASIC_TIMER_INTERVAL);

View file

@ -0,0 +1,36 @@
# Parameters:
# 1 - $BACKTRACE_UPLOAD_TOKEN
# 2 - $SYMBOLS_ARCHIVE
# 3 - $RELEASE_NUMBER
#
import sys
import urllib.request
import urllib.parse
print("Running python script to upload to BackTrace")
post_headers = {}
post_headers['Content-Type'] = 'application/json'
post_headers['Expect'] = ''
post_url = 'https://highfidelity.sp.backtrace.io:6098/post?format=symbols&token=' + sys.argv[1] + '&upload_file=' + sys.argv[2] + '&tag=' + sys.argv[3]
try:
post_data = open(sys.argv[2], 'rb')
except:
print('file ' + sys.argv[2] + ' not found')
exit(1)
try:
post_request = urllib.request.Request(post_url, post_data, post_headers)
except:
print('urllib.request.Request failed')
exit(1)
try:
post_response = urllib.request.urlopen(post_request)
except:
print('urllib.request.urlopen failed')
exit(1)
print("Upload to BackTrace completed without errors")