From 1522a0fb379233d61fbe3722a7c98e094a1e7c89 Mon Sep 17 00:00:00 2001 From: tristan Date: Tue, 18 Dec 2018 17:38:30 +0100 Subject: [PATCH] UPBGE: Fix components of group instances. Previously group instances were created in pre conversion (BL_ConvertBlenderObjects) but only added to scene active objects. In post conversion (BL_PostConvertBlenderObjects) where the component conversion take place, only the objects in the converter are converting components, but these are not group instances. This introduced that group instance could not use components. To solve this issue, the group instances must be created after component conversion as a normal object is duplicated. Fix issue: #957. --- .../Converter/BL_BlenderDataConversion.cpp | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 2fbacea0b97a..0d2928e9aa94 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1834,19 +1834,6 @@ void BL_ConvertBlenderObjects(struct Main *maggie, // Cleanup converted set of group objects. convertedlist->Release(); logicbrick_conversionlist->Release(); - - /* Instantiate dupli group, we will loop trough the object - * that are in active layers. Note that duplicating group - * has the effect of adding objects at the end of objectlist. - * Only loop through the first part of the list. - */ - int objcount = objectlist->GetCount(); - for (unsigned int i = 0; i < objcount; ++i) { - KX_GameObject *gameobj = objectlist->GetValue(i); - if (gameobj->IsDupliGroup()) { - kxscene->DupliGroupRecurse(gameobj, 0); - } - } } void BL_PostConvertBlenderObjects(KX_Scene *kxscene, const BL_SceneConverter& sceneconverter) @@ -1912,5 +1899,18 @@ void BL_PostConvertBlenderObjects(KX_Scene *kxscene, const BL_SceneConverter& sc } } } + + /* Instantiate dupli group, we will loop trough the object + * that are in active layers. Note that duplicating group + * has the effect of adding objects at the end of objectlist. + * Only loop through the first part of the list. + */ + const unsigned int objcount = objectlist->GetCount(); + for (unsigned int i = 0; i < objcount; ++i) { + KX_GameObject *gameobj = objectlist->GetValue(i); + if (gameobj->IsDupliGroup()) { + kxscene->DupliGroupRecurse(gameobj, 0); + } + } }