mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-17 08:06:19 +02:00
filter out left/right hands from joints list in avatarapp
should fix: FB17884 - Wearable disappears when added to some joints FB17885 - Changing werable joint moves the model and detaches from avatar body
This commit is contained in:
parent
156f1dc60d
commit
cb1855b0d7
2 changed files with 26 additions and 6 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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: {
|
||||||
|
|
Loading…
Reference in a new issue