Index: source/blender/python/api2_2x/Scene.c =================================================================== --- source/blender/python/api2_2x/Scene.c (revision 19861) +++ source/blender/python/api2_2x/Scene.c (working copy) @@ -138,8 +138,8 @@ static PyObject *Scene_copy( BPy_Scene * self, PyObject * arg ); static PyObject *Scene_makeCurrent( BPy_Scene * self ); static PyObject *Scene_update( BPy_Scene * self, PyObject * args ); -static PyObject *Scene_link( BPy_Scene * self, PyObject * args ); -static PyObject *Scene_unlink( BPy_Scene * self, PyObject * args ); +static PyObject *Scene_direct_link( BPy_Scene * self, PyObject * args ); +static PyObject *Scene_direct_unlink( BPy_Scene * self, PyObject * args ); static PyObject *Scene_getChildren( BPy_Scene * self ); static PyObject *Scene_getActiveObject(BPy_Scene *self); static PyObject *Scene_getCurrentCamera( BPy_Scene * self ); @@ -184,9 +184,9 @@ "(full = 0) - Update scene self.\n" "full = 0: sort the base list of objects." "full = 1: full update -- also regroups, does ipos, keys"}, - {"link", ( PyCFunction ) Scene_link, METH_VARARGS, + {"link", ( PyCFunction ) Scene_direct_link, METH_VARARGS, "(obj) - Link Object obj to this scene"}, - {"unlink", ( PyCFunction ) Scene_unlink, METH_VARARGS, + {"unlink", ( PyCFunction ) Scene_direct_unlink, METH_VARARGS, "(obj) - Unlink Object obj from this scene"}, {"getChildren", ( PyCFunction ) Scene_getChildren, METH_NOARGS, "() - Return list of all objects linked to this scene"}, @@ -844,12 +844,6 @@ Scene *scene = self->scene; BPy_Object *bpy_obj; Object *object = NULL; - static char warning = 1; - - if( warning ) { - printf("scene.link(ob) deprecated!\n\tuse scene.objects.link(ob) instead\n"); - --warning; - } SCENE_DEL_CHECK_PY(self); @@ -914,18 +908,24 @@ Py_RETURN_NONE; } +static PyObject *Scene_direct_link( BPy_Scene * self, PyObject * args ) +{ + static char warning = 1; + + if( warning ) { + printf("scene.link(ob) deprecated!\n\tuse scene.objects.link(ob) instead\n"); + --warning; + } + + return Scene_link( self, args ); +} + /*-----------------------Scene.unlink()----------------------------------*/ static PyObject *Scene_unlink( BPy_Scene * self, PyObject * args ) { BPy_Object *bpy_obj = NULL; Scene *scene = self->scene; Base *base; - static char warning = 1; - - if( warning ) { - printf("scene.unlink(ob) deprecated!\n\tuse scene.objects.unlink(ob) instead\n"); - --warning; - } SCENE_DEL_CHECK_PY(self); @@ -947,6 +947,18 @@ Py_RETURN_FALSE; } +static PyObject *Scene_direct_unlink( BPy_Scene * self, PyObject * args ) +{ + static char warning = 1; + + if( warning ) { + printf("scene.unlink(ob) deprecated!\n\tuse scene.objects.unlink(ob) instead\n"); + --warning; + } + + return Scene_unlink( self, args ); +} + /*-----------------------Scene.getChildren()-----------------------------*/ static PyObject *Scene_getChildren( BPy_Scene * self ) {