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-12 00:58:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-04-12 00:58:09 +0400
commit4cd088b1059afa2e7b998c184b2c9deecd4be4a9 (patch)
tree48483da057f8a56a99db81e3dfbf5f1086d46374 /source/gameengine/Ketsji/KX_Scene.h
parent37e53b2e1f8107cb8ddbee2d67bf984a70a71276 (diff)
BGE Py API
- setting the scene attributes would always add to the scenes custom dictionary. - new CListValue method from_id(id) so you can store a Game Objects id and use it to get the game object back. ob_id = id(gameOb) ... gameOb = scene.objects.from_id(ob_id) This is useful because names are not always unique.
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.h')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h
index 9f05ddf70c2..1bdfbd45d20 100644
--- a/source/gameengine/Ketsji/KX_Scene.h
+++ b/source/gameengine/Ketsji/KX_Scene.h
@@ -590,6 +590,27 @@ public:
/* for dir(), python3 uses __dir__() */
static PyObject* pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
+ static int py_base_setattro_scene(PyObject * self, PyObject *attr, PyObject *value)
+ {
+ if (value==NULL)
+ return ((PyObjectPlus*) self)->py_delattro(attr);
+
+ int ret= ((PyObjectPlus*) self)->py_setattro(attr, value);
+
+ if (ret) {
+ if (!PyDict_SetItem(((KX_Scene *) self)->m_attrlist, attr, value)) {
+ PyErr_Clear();
+ ret= 0;
+ }
+ else {
+ ret= -1;
+ }
+ }
+
+ return ret;
+ }
+
+
virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */
virtual int py_setattro(PyObject *attr, PyObject *pyvalue);