diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-21 23:44:52 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-21 23:44:52 +0400 |
commit | 589ce4a005ce16c5a628cd51819e20623a23c891 (patch) | |
tree | 111a9dc91ad3f1843694d47aaf8eb66c1358820d /source/blender/python/api2_2x/World.c | |
parent | c5214c15716715cd513e1d2b61433784eb64b617 (diff) |
BPython:
- based on a request by Campbell (he also provided a patch for scene.Layer) access to layers was improved a little, keeping the old method (ob.Layers is a bitmask) and adding the nicer one (ob.layers is a list of ints). Done for objects and scenes. House-cleaning: .Layer was renamed to .Layers (actually just using strncmp instead of strcmp, so both work, same done for Window.ViewLayers).
- finally committing patch by Ken Hughes to let .clearScriptLinks() accept a parameter (list of strings) to clear only specified texts.
- doc updates and fixes (JMS reported a problem in nmesh.transform() example code).
Thanks all who contributed.
Diffstat (limited to 'source/blender/python/api2_2x/World.c')
-rw-r--r-- | source/blender/python/api2_2x/World.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/python/api2_2x/World.c b/source/blender/python/api2_2x/World.c index e6c5b3b67a3..fa8b57bd809 100644 --- a/source/blender/python/api2_2x/World.c +++ b/source/blender/python/api2_2x/World.c @@ -97,7 +97,7 @@ static PyObject *World_getMist( BPy_World * self ); static PyObject *World_setMist( BPy_World * self, PyObject * args ); static PyObject *World_getScriptLinks( BPy_World * self, PyObject * args ); static PyObject *World_addScriptLink( BPy_World * self, PyObject * args ); -static PyObject *World_clearScriptLinks( BPy_World * self ); +static PyObject *World_clearScriptLinks( BPy_World * self, PyObject * args ); static PyObject *World_setCurrent( BPy_World * self ); @@ -217,8 +217,9 @@ static PyMethodDef BPy_World_methods[] = { "(text) - string: an existing Blender Text name;\n" "(evt) string: FrameChanged or Redraw."}, {"clearScriptLinks", ( PyCFunction ) World_clearScriptLinks, - METH_NOARGS, - "() - Delete all scriptlinks from this world :)."}, + METH_VARARGS, + "() - Delete all scriptlinks from this world.\n" + "([s1<,s2,s3...>]) - Delete specified scriptlinks from this world."}, {"setCurrent", ( PyCFunction ) World_setCurrent, METH_NOARGS, "() - Makes this world the active world for the current scene."}, {"makeActive", ( PyCFunction ) World_setCurrent, METH_NOARGS, @@ -856,22 +857,18 @@ static PyObject *World_addScriptLink( BPy_World * self, PyObject * args ) slink = &( world )->scriptlink; - if( !EXPP_addScriptLink( slink, args, 0 ) ) - return EXPP_incr_ret( Py_None ); - else - return NULL; + return EXPP_addScriptLink( slink, args, 0 ); } /* world.clearScriptLinks */ -static PyObject *World_clearScriptLinks( BPy_World * self ) +static PyObject *World_clearScriptLinks( BPy_World * self, PyObject * args ) { World *world = self->world; ScriptLink *slink = NULL; slink = &( world )->scriptlink; - return EXPP_incr_ret( Py_BuildValue - ( "i", EXPP_clearScriptLinks( slink ) ) ); + return EXPP_clearScriptLinks( slink, args ); } /* world.getScriptLinks */ |