diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index 9df7ebfc55aa37c7218a592193d4f44292fc520a..c20b41d542f45e11c807e50c97308b6a8472a886 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; +} + + /*@{*/ /** diff --git a/source/blender/python/api2_2x/doc/World.py b/source/blender/python/api2_2x/doc/World.py index 55b3cf2dc8c2f94815c241df07842d446b279887..a8d10ce7073acf88eb730a70d4d9bf4d49e3dbe6 100644 --- a/source/blender/python/api2_2x/doc/World.py +++ b/source/blender/python/api2_2x/doc/World.py @@ -314,3 +314,10 @@ class World: @type event: string @param event: "FrameChanged" or "Redraw". """ + + def makeActive (): + """ + Make this world active in the current scene. + @rtype: PyNone + @return: PyNone + """