Commit: 5dc22fbbfbed0e825faa8faab8bc5f32a6fdd829
Author: Porteries Tristan
Date:   Fri May 15 19:05:08 2015 +0200
Branches: master
https://developer.blender.org/rB5dc22fbbfbed0e825faa8faab8bc5f32a6fdd829

BGE: Fix T41299 Group API for child object in dupli instance group.

===================================================================

M       source/gameengine/Ketsji/KX_Scene.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp 
b/source/gameengine/Ketsji/KX_Scene.cpp
index 5ec1c2e..8ed8ca6 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

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to