==python api==

patch from jean-michel soler (jms) - .insertShapeKey()

Python API, a function to insert a shape key in an object . It works on Mesh, Lattice curve ans surface .
Example of use :

import Blender
OBJECT=Blender.Object.GetSelected()[0]
OBJECT.insertShapeKey()

a docstring to follow soon
This commit is contained in:
Tom Musgrove 2006-01-17 06:47:48 +00:00
parent aeffb121c8
commit 427b132ad0

@ -94,6 +94,7 @@ struct rctf;
#include "Effect.h" #include "Effect.h"
#include "Pose.h" #include "Pose.h"
#include "gen_utils.h" #include "gen_utils.h"
#include "BIF_editkey.h"
/* Defines for insertIpoKey */ /* Defines for insertIpoKey */
@ -280,6 +281,7 @@ static PyObject *Object_getSBUseEdges( BPy_Object * self );
static PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args ); static PyObject *Object_setSBUseEdges( BPy_Object * self, PyObject * args );
static PyObject *Object_getSBStiffQuads( BPy_Object * self ); static PyObject *Object_getSBStiffQuads( BPy_Object * self );
static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args ); static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args );
static PyObject *Object_insertShapeKey(BPy_Object * self);
/*****************************************************************************/ /*****************************************************************************/
/* Python BPy_Object methods table: */ /* Python BPy_Object methods table: */
/*****************************************************************************/ /*****************************************************************************/
@ -564,6 +566,8 @@ works only if self and the object specified are of the same type."},
"([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."}, "([s1<,s2,s3...>]) - Delete specified scriptlinks from this object."},
{"setDupliVerts", ( PyCFunction ) Object_setDupliVerts, {"setDupliVerts", ( PyCFunction ) Object_setDupliVerts,
METH_VARARGS, "() - set or reset duplicate child objects on all vertices"}, METH_VARARGS, "() - set or reset duplicate child objects on all vertices"},
{"insertShapeKey", ( PyCFunction ) Object_insertShapeKey,
METH_NOARGS, "() - Insert a Shape Key in the current object"},
{"getPose", (PyCFunction)Object_getPose, METH_NOARGS, {"getPose", (PyCFunction)Object_getPose, METH_NOARGS,
"() - returns the pose from an object if it exists, else None"}, "() - returns the pose from an object if it exists, else None"},
{NULL, NULL, 0, NULL} {NULL, NULL, 0, NULL}
@ -2783,6 +2787,12 @@ static PyObject *Object_getEffects( BPy_Object * self )
return effect_list; return effect_list;
} }
static PyObject *Object_insertShapeKey(BPy_Object * self)
{
insert_shapekey(self->object);
return Py_None;
}
static PyObject * Object_getPose(BPy_Object *self) static PyObject * Object_getPose(BPy_Object *self)
{ {
//if there is no pose will return PyNone //if there is no pose will return PyNone