Blender Git Commit Log

Git Commits -> Revision e8f4d93

Revision e8f4d93 by Campbell Barton (master)
April 15, 2009, 10:57 (GMT)
Disable using KX_GameObjects in python that have been removed from the scene (zombie objects) by raising a RuntimeError when accessing methods, attributes or passing to a function.

Common cases of this are when python references an object from the AddObject actuator that has ended, or a scene has been loaded and the old objects freed.

This means some scripts will raise errors now in certain cases but better give the error early rather then failing silently with strange hard to track down behavior & crashes.

Added "isValid" attribute for checking objects are in a scene.

At the moment it uses the SceneGraph Node to check of the objects valid but it might be better to do this in a more generic way so scenes, meshes etc also have this check.

Commit Details:

Full Hash: e8f4d9322112e64677df11ba834a26159874b332
SVN Revision: 19728
Parent Commit: 19c869a
Lines Changed: +186, -105

5 Modified Paths:

/source/gameengine/Ketsji/KX_Camera.cpp (+11, -0) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+147, -5) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+11, -99) (Diff)
/source/gameengine/Ketsji/KX_Light.cpp (+14, -1) (Diff)
/source/gameengine/PyDoc/KX_GameObject.py (+3, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021