diff options
author | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-05-15 20:05:08 +0300 |
---|---|---|
committer | Porteries Tristan <republicthunderbolt9@gmail.com> | 2015-05-15 20:17:15 +0300 |
commit | 5dc22fbbfbed0e825faa8faab8bc5f32a6fdd829 (patch) | |
tree | 66360172e5215a3d4a48e771e6283c5edcf804fe /source/gameengine/Ketsji/KX_Scene.cpp | |
parent | ce0d3112e40fe54bd56926b758cda4e502fb782a (diff) |
BGE: Fix T41299 Group API for child object in dupli instance group.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 5ec1c2e2846..8ed8ca6f148 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -809,13 +809,6 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) // we can now add the graphic controller to the physic engine replica->ActivateGraphicController(true); - // set references for dupli-group - // groupobj holds a list of all objects, that belongs to this group - groupobj->AddInstanceObjects(replica); - - // every object gets the reference to its dupli-group object - replica->SetDupliGroupObject(groupobj); - // done with replica replica->Release(); } @@ -826,6 +819,14 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level) for (git = m_logicHierarchicalGameObjects.begin(); git != m_logicHierarchicalGameObjects.end(); ++git) { KX_GameObject *gameobj = *git; + if (gameobj->GetBlenderGroupObject() == blgroupobj) { + // set references for dupli-group + // groupobj holds a list of all objects, that belongs to this group + groupobj->AddInstanceObjects(gameobj); + // every object gets the reference to its dupli-group object + gameobj->SetDupliGroupObject(groupobj); + } + gameobj->ReParentLogic(); // relink any pointers as necessary, sort of a temporary solution |