BGE: Fix T41299 Group API for child object in dupli instance group.
This commit is contained in:
parent
ce0d3112e4
commit
5dc22fbbfb
Notes:
blender-bot
2023-02-14 10:16:27 +01:00
Referenced by commit c8f6313487
, Fix T45428: Sometimes in a dupligroup linked actuators are not triggered
Referenced by issue #45428, Sometimes in a dupligroup linked actuators are not triggered
Referenced by issue #41299, BGE: Group API not working correct.
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue