Don't reparent model node with clusters if it's a root node

This commit is contained in:
David Rowe 2018-02-01 13:39:57 +13:00
parent 453d0038d6
commit 4cd130dd63

View file

@ -1455,6 +1455,9 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
QSet<QString> remainingModels;
for (QHash<QString, FBXModel>::const_iterator model = models.constBegin(); model != models.constEnd(); model++) {
// models with clusters must be parented to the cluster top
// Unless the model is a root node.
bool isARootNode = !modelIDs.contains(_connectionParentMap.value(model.key()));
if (!isARootNode) {
foreach(const QString& deformerID, _connectionChildMap.values(model.key())) {
foreach(const QString& clusterID, _connectionChildMap.values(deformerID)) {
if (!clusters.contains(clusterID)) {
@ -1466,7 +1469,8 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS
goto outerBreak;
}
}
outerBreak:
outerBreak: ;
}
// make sure the parent is in the child map
QString parent = _connectionParentMap.value(model.key());