diff options
author | Jacques Guignot <guignot@wanadoo.fr> | 2004-06-22 15:38:58 +0400 |
---|---|---|
committer | Jacques Guignot <guignot@wanadoo.fr> | 2004-06-22 15:38:58 +0400 |
commit | f89f32d420c78a6204a6b7f5efa269f13e35e8ea (patch) | |
tree | c1c36ea93e57aed22aeb537f67d762cb737f8ab1 /source/blender/python/api2_2x/World.c | |
parent | ee07502a043fe1ebf07245f1b97181fe56b5096c (diff) |
added a new function to the World module : GetActive(), which returns the world associated to the scene, or None if no such world exists
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r-- | source/blender/python/api2_2x/World.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 2010a46b02a..056fdcc9281 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -203,6 +203,22 @@ static PyObject *M_World_Get(PyObject *self, PyObject *args) } } + + + +static PyObject *M_World_GetActive(PyObject *self) +{ + BPy_World *w = NULL; + if(!G.scene->world) + { + Py_INCREF(Py_None); + return Py_None; + } + w = (BPy_World *)PyObject_NEW(BPy_World, &World_Type); + w->world = G.scene->world; + return (PyObject *)w; +} + /*@}*/ /** |