- 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.
This commit is contained in:
2005-04-21 19:44:52 +00:00
parent c5214c1571
commit 589ce4a005
24 changed files with 657 additions and 347 deletions

View File

@@ -26,7 +26,7 @@
* This is a new part of Blender.
*
* Contributor(s): Willian P. Germano, Michel Selten, Alex Mole,
* Alexander Szakaly, Campbell Barton
* Alexander Szakaly, Campbell Barton, Ken Hughes
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
@@ -487,11 +487,9 @@ static PyObject *Material_clearTexture( BPy_Material * self, PyObject * args );
static PyObject *Material_setColorComponent( BPy_Material * self, char *key,
PyObject * args );
static PyObject *Material_getScriptLinks( BPy_Material * self,
PyObject * args );
static PyObject *Material_addScriptLink( BPy_Material * self,
PyObject * args );
static PyObject *Material_clearScriptLinks( BPy_Material * self );
static PyObject *Material_getScriptLinks(BPy_Material *self, PyObject * args );
static PyObject *Material_addScriptLink(BPy_Material * self, PyObject * args );
static PyObject *Material_clearScriptLinks(BPy_Material *self, PyObject *args);
static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args );
@@ -668,8 +666,9 @@ static PyMethodDef BPy_Material_methods[] = {
"(text) - string: an existing Blender Text name;\n"
"(evt) string: FrameChanged or Redraw."},
{"clearScriptLinks", ( PyCFunction ) Material_clearScriptLinks,
METH_NOARGS,
"() - Delete all scriptlinks from this material."},
METH_VARARGS,
"() - Delete all scriptlinks from this material.\n"
"([s1<,s2,s3...>]) - Delete specified scriptlinks from this material."},
{NULL, NULL, 0, NULL}
};
@@ -1977,22 +1976,18 @@ static PyObject *Material_addScriptLink( BPy_Material * self, PyObject * args )
slink = &( mat )->scriptlink;
if( !EXPP_addScriptLink( slink, args, 0 ) )
return EXPP_incr_ret( Py_None );
else
return NULL;
return EXPP_addScriptLink( slink, args, 0 );
}
/* mat.clearScriptLinks */
static PyObject *Material_clearScriptLinks( BPy_Material * self )
static PyObject *Material_clearScriptLinks(BPy_Material *self, PyObject *args )
{
Material *mat = self->material;
ScriptLink *slink = NULL;
slink = &( mat )->scriptlink;
return EXPP_incr_ret( Py_BuildValue
( "i", EXPP_clearScriptLinks( slink ) ) );
return EXPP_clearScriptLinks( slink, args );
}
/* mat.getScriptLinks */