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

my_world.makeActive()

Contributed by Campbell Barton (ideasman)
This commit is contained in:
Stephen Swaney
2004-09-20 16:22:32 +00:00
parent 3eddbfa942
commit 273c8e0804
2 changed files with 22 additions and 0 deletions

View File

@@ -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;
}
/*@{*/
/**

View File

@@ -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
"""