Check node parents in ValidateDataStructure
parent
48d89622ee
commit
ea3cc37890
|
@ -911,7 +911,12 @@ void ValidateDSProcess::Validate(const aiNode *pNode) {
|
||||||
nodeName, pNode->mNumChildren);
|
nodeName, pNode->mNumChildren);
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < pNode->mNumChildren; ++i) {
|
for (unsigned int i = 0; i < pNode->mNumChildren; ++i) {
|
||||||
Validate(pNode->mChildren[i]);
|
const aiNode *pChild = pNode->mChildren[i];
|
||||||
|
Validate(pChild);
|
||||||
|
if (pChild->mParent != pNode) {
|
||||||
|
const char *parentName = (pChild->mParent != nullptr) ? pChild->mParent->mName.C_Str() : "null";
|
||||||
|
ReportError("aiNode \"%s\" child %i \"%s\" parent is someone else: \"%s\"", pNode->mName.C_Str(), i, pChild->mName.C_Str(), parentName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue