Skip to content
Snippets Groups Projects
Commit 273c8e08 authored by Stephen Swaney's avatar Stephen Swaney
Browse files

New bpy method for World module to set World for current scene:

	my_world.makeActive()

Contributed by Campbell Barton (ideasman)
parent 3eddbfa9
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
/*@{*/
/**
......
......@@ -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
"""
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment