From f07b1fa4c52af97f9adab2ba6e9678a75fe6aa2b Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Thu, 15 Feb 2018 11:32:29 -0800 Subject: [PATCH] Revert "FBX node IDs aren't alphanumerically ordered per logical structure" This reverts commit a7ec4501e65396d4c7bf2316dd73188cea7a3c7d. Because remainingModels is a QSet, the order is not guaranteed. Therefore the same code iterating over the same items will sometimes have a different ordering. See docs for QSet, http://doc.qt.io/qt-5/qset.html This was bug was causing scrambled avatars, because both the transmitter and receiver of the AvatarData packets make the strong assumption that the joint orders are same. When they are not the avatar's appear scrambled. --- libraries/fbx/src/FBXReader.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 4ed1ca38dc..14f12b5d1b 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -1481,6 +1481,11 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS } while (!remainingModels.isEmpty()) { QString first = *remainingModels.constBegin(); + foreach (const QString& id, remainingModels) { + if (id < first) { + first = id; + } + } QString topID = getTopModelID(_connectionParentMap, models, first, url); appendModelIDs(_connectionParentMap.value(topID), _connectionChildMap, models, remainingModels, modelIDs, true); }