Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-04-23 04:32:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-23 04:32:33 +0400
commit6a270ecb9435fd695988de5c685c65cac5a43c79 (patch)
tree6bc0b992e1a1ee44b739be6e76b860ae6c0c8aba /source/gameengine/Ketsji/KX_Scene.cpp
parentd568794a9873eed10a9d240c1e1a1ba52aba929c (diff)
BGE Python API
CListValue fixes - Disable changing CValueLists that the BGE uses internally (scene.objects.append(1) would crash when drawing) - val=clist+list would modify clist in place, now return a new value. - clist.append([....]), was working like extend. - clist.append(val) didnt work for most CValue types like KX_GameObjects. Other changes - "isValid" was always returning True. - Set all errors for invalid proxy access to PyExc_SystemError (was using a mix of error types) - Added PyObjectPlus::InvalidateProxy() to manually invalidate, though if python ever gains access again, it will make a new valid proxy. This is so removing an object from a scene can invalidate the object even if its stored elsewhere in a CValueList for eg.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 6917305522e..0c26a6a7b3b 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -891,7 +891,15 @@ void KX_Scene::RemoveObject(class CValue* gameobj)
{
KX_GameObject* newobj = (KX_GameObject*) gameobj;
- // first disconnect child from parent
+ /* Invalidate the python reference, since the object may exist in script lists
+ * its possible that it wont be automatically invalidated, so do it manually here,
+ *
+ * if for some reason the object is added back into the scene python can always get a new Proxy
+ */
+ gameobj->InvalidateProxy();
+
+
+ // disconnect child from parent
SG_Node* node = newobj->GetSGNode();
if (node)