fix constraint import some more

This commit is contained in:
Seth Alves 2017-05-12 13:03:51 -07:00
parent bc6fb182eb
commit 630d95a812
3 changed files with 7 additions and 7 deletions

View file

@ -1622,7 +1622,8 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra
};
entityTreeElement->forEachEntity([&args, &getMapped, &element](EntityItemPointer item) {
EntityItemID newID = getMapped(item->getEntityItemID());
EntityItemID oldID = item->getEntityItemID();
EntityItemID newID = getMapped(oldID);
EntityItemProperties properties = item->getProperties();
EntityItemID oldParentID = properties.getParentID();

View file

@ -178,11 +178,9 @@ bool ObjectConstraintBallSocket::updateArguments(QVariantMap arguments) {
QVariantMap ObjectConstraintBallSocket::getArguments() {
QVariantMap arguments = ObjectDynamic::getArguments();
withReadLock([&] {
if (_constraint) {
arguments["pivot"] = glmToQMap(_pivotInA);
arguments["otherEntityID"] = _otherID;
arguments["otherPivot"] = glmToQMap(_pivotInB);
}
arguments["pivot"] = glmToQMap(_pivotInA);
arguments["otherEntityID"] = _otherID;
arguments["otherPivot"] = glmToQMap(_pivotInB);
});
return arguments;
}

View file

@ -35,8 +35,9 @@ void ObjectDynamic::remapIDs(QHash<EntityItemID, EntityItemID>& map) {
QHash<EntityItemID, EntityItemID>::iterator iter = map.find(_otherID);
if (iter == map.end()) {
// not found, add it
QUuid oldOtherID = _otherID;
_otherID = QUuid::createUuid();
map.insert(_otherID, _otherID);
map.insert(oldOtherID, _otherID);
} else {
_otherID = iter.value();
}