diff options
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r-- | source/blender/python/api2_2x/World.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 9df7ebfc55a..c20b41d542f 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -680,6 +680,21 @@ static PyObject *World_getScriptLinks (BPy_World *self, PyObject *args) } + +/* world.makeActive */ +static PyObject *World_makeActive (BPy_World *self) +{ + World *world = self->world; + /* If there is a world then it now has one less user */ + if( G.scene->world) + G.scene->world->id.us--; + world->id.us++; + G.scene->world = world; + Py_INCREF(Py_None); + return Py_None; +} + + /*@{*/ /** |