diff options
author | Stephen Swaney <sswaney@centurytel.net> | 2004-09-20 20:22:32 +0400 |
---|---|---|
committer | Stephen Swaney <sswaney@centurytel.net> | 2004-09-20 20:22:32 +0400 |
commit | 273c8e08041111714e47dbb0d50604553fd5f854 (patch) | |
tree | be427861de8d11b86632de0ca73badad57d85825 /source/blender/python/api2_2x/World.c | |
parent | 3eddbfa9420d1b4050c22fe761eb8fbc0984b665 (diff) |
New bpy method for World module to set World for current scene:
my_world.makeActive()
Contributed by Campbell Barton (ideasman)
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; +} + + /*@{*/ /** |