From 332032fb9925091da49efa2e9c3653bdb3e68cba Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 12 Apr 2009 14:22:51 +0000 Subject: BGE Python API Support for assigning any Type to a KX_GameObject so you can do... gameOb.follow = otherGameOb gameOb[otherGameOb] = distanceTo gameOb["path"] = [(x,y,x), (x,y,x)] del gameOb[mesh] * types that cannot be converted into CValue types are written into the KX_GameObject dict * the KX_GameObject dict is only initialized when needed * Python properties in this dict cannot be accessed by logic bricks * dir(ob) and ob.getPropertyNames() return items from both CValue and Py dictionary properties. Also found that CType was converting python lists to CType Lists but very buggy, would crash after printing the list most times. Use python lists instead since logic bricks dont deal with lists. --- source/gameengine/Ketsji/KX_Scene.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source/gameengine/Ketsji/KX_Scene.h') diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index b70c6d3e8d3..55e7afa4957 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -603,6 +603,7 @@ public: ret= PY_SET_ATTR_SUCCESS; } else { + PyErr_Format(PyExc_AttributeError, "failed assigning value to KX_Scenes internal dictionary"); ret= PY_SET_ATTR_FAIL; } } -- cgit v1.2.3