diff options
author | Tom Musgrove <LetterRip@gmail.com> | 2006-01-17 09:47:48 +0300 |
---|---|---|
committer | Tom Musgrove <LetterRip@gmail.com> | 2006-01-17 09:47:48 +0300 |
commit | 427b132ad0e25a8236d0094dbeeb825ec74740dc (patch) | |
tree | 2653a2a925111b00c898d526ad095b2e7b7efafa | |
parent | aeffb121c8766def73bd81d03e85450c8d48114f (diff) |
==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
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index 18fe85712f9..472d8d08043 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -94,6 +94,7 @@ struct rctf; #include "Effect.h" #include "Pose.h" #include "gen_utils.h" +#include "BIF_editkey.h" /* 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_getSBStiffQuads( BPy_Object * self ); static PyObject *Object_setSBStiffQuads( BPy_Object * self, PyObject * args ); +static PyObject *Object_insertShapeKey(BPy_Object * self); /*****************************************************************************/ /* 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."}, {"setDupliVerts", ( PyCFunction ) Object_setDupliVerts, 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, "() - returns the pose from an object if it exists, else None"}, {NULL, NULL, 0, NULL} @@ -2783,6 +2787,12 @@ static PyObject *Object_getEffects( BPy_Object * self ) return effect_list; } +static PyObject *Object_insertShapeKey(BPy_Object * self) +{ + insert_shapekey(self->object); + return Py_None; +} + static PyObject * Object_getPose(BPy_Object *self) { //if there is no pose will return PyNone |