Merge pull request #13897 from ElderOrb/filter_out_hands_from_joints

filter out left/right hands from joints list in avatarapp
This commit is contained in:
Brad Hefta-Gaub 2018-09-11 09:34:48 -07:00 committed by GitHub
commit 299e9d0d38
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 6 deletions

View file

@ -46,7 +46,7 @@ Rectangle {
} }
} }
property var jointNames; property var jointNames: []
property var currentAvatarSettings; property var currentAvatarSettings;
function fetchAvatarModelName(marketId, avatar) { function fetchAvatarModelName(marketId, avatar) {

View file

@ -25,7 +25,17 @@ Rectangle {
modified = false; modified = false;
} }
property var jointNames; property var jointNames: []
onJointNamesChanged: {
jointsModel.clear();
for (var i = 0; i < jointNames.length; ++i) {
var jointName = jointNames[i];
if (jointName !== 'LeftHand' && jointName !== 'RightHand') {
jointsModel.append({'text' : jointName, 'jointIndex' : i});
}
}
}
property string avatarName: '' property string avatarName: ''
property var wearablesModel; property var wearablesModel;
@ -268,20 +278,30 @@ Rectangle {
anchors.right: parent.right anchors.right: parent.right
enabled: getCurrentWearable() !== null && !isSoft.checked enabled: getCurrentWearable() !== null && !isSoft.checked
comboBox.displayText: isSoft.checked ? 'Hips' : comboBox.currentText comboBox.displayText: isSoft.checked ? 'Hips' : comboBox.currentText
comboBox.textRole: "text"
model: jointNames model: ListModel {
id: jointsModel
}
property bool notify: false property bool notify: false
function set(jointIndex) { function set(jointIndex) {
notify = false; notify = false;
currentIndex = jointIndex; for (var i = 0; i < jointsModel.count; ++i) {
if (jointsModel.get(i).jointIndex === jointIndex) {
currentIndex = i;
break;
}
}
notify = true; notify = true;
} }
function notifyJointChanged() { function notifyJointChanged() {
modified = true; modified = true;
var jointIndex = jointsModel.get(jointsCombobox.currentIndex).jointIndex;
var properties = { var properties = {
parentJointIndex: currentIndex, parentJointIndex: jointIndex,
localPosition: { localPosition: {
x: positionVector.xvalue, x: positionVector.xvalue,
y: positionVector.yvalue, y: positionVector.yvalue,
@ -294,7 +314,7 @@ Rectangle {
} }
}; };
wearableUpdated(getCurrentWearable().id, wearablesCombobox.currentIndex, properties); wearableUpdated(getCurrentWearable().id, jointIndex, properties);
} }
onCurrentIndexChanged: { onCurrentIndexChanged: {