From 5a8c15d826120f7b3d941c68da0b40ba3de26c27 Mon Sep 17 00:00:00 2001 From: tomacd Date: Mon, 18 Apr 2016 11:28:21 +0200 Subject: [PATCH] fix SceneCombiner copy of aiNode not setting mParent field --- code/SceneCombiner.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/SceneCombiner.cpp b/code/SceneCombiner.cpp index b56e2e601..5a138f809 100644 --- a/code/SceneCombiner.cpp +++ b/code/SceneCombiner.cpp @@ -1211,6 +1211,11 @@ void SceneCombiner::Copy (aiNode** _dest, const aiNode* src) // and reallocate all arrays GetArrayCopy( dest->mMeshes, dest->mNumMeshes ); CopyPtrArray( dest->mChildren, src->mChildren,dest->mNumChildren); + + // need to set the mParent fields to the created aiNode. + for( unsigned int i = 0; i < dest->mNumChildren; i ++ ) { + dest->mChildren[i]->mParent = dest; + } } // ------------------------------------------------------------------------------------------------