Page MenuHome

Fix T48071: Global logic manager

Authored by Porteries Tristan (panzergame) on Apr 10 2016, 11:41 PM.



Previously the logic manager was used as a global variable for SCA_ILogicBrick::m_sCurrentLogicManager, this request to always update it before run any python script and allow call function like ConvertPythonTo[GameObject/Mesh]
The bug showed in T48071 is that as exepted the global m_sCurrentLogicManager is not updated with the proper scene logic manager.
Instead of trying to fix it by updating the logic manager everywhere and wait next bug report to add a similar line. The following patch propose a different way:

  • Every logic brick now contain its logic manager to SCA_ILogicBrick::m_logicManager, this value is set and get by SCA_ILogicBrick::[Set/Get]LogicManager, It's initialized from blender conversion and scene merging.
  • Function ConvertPythonTo[GameObject/mesh] now take as first argument the logic manager to find name coresponding object or mesh. Only ConvertPythonToCamera doesn't do that because it use the KX_Scene::FindCamera function.

Diff Detail

rB Blender

Event Timeline

Porteries Tristan (panzergame) retitled this revision from to Fix T48071: Global logic manager.
Porteries Tristan (panzergame) updated this object.
Mitchell Stokes (moguri) edited edge metadata.

Looks good to me. I think we can safely commit this even without 2 reviews.

This revision is now accepted and ready to land.Apr 10 2016, 11:46 PM

The original idea was to get the scene from the BL_ArmatureObject but the override function "Scene BL_Armatureobject::GetScene()" disallow to get the KX_Scene.

This revision was automatically updated to reflect the committed changes.