diff options
author | Joshua Leung <aligorith@gmail.com> | 2008-09-20 14:30:10 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2008-09-20 14:30:10 +0400 |
commit | a12375cb4f8dd97b8985854486485a94a869a5f1 (patch) | |
tree | a8afe0f86c911e22ace9d69036e9e0ac75b5c54a /source/blender/python/api2_2x/Camera.c | |
parent | 224607982ad664eaccfd703cff105eb6393b2d3e (diff) |
PyAPI - *.insertkey()
Updated insertkey calls in PyAPI so that they behave like the new common_insertkey() behaviour.
Diffstat (limited to 'source/blender/python/api2_2x/Camera.c')
-rw-r--r-- | source/blender/python/api2_2x/Camera.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c index 87c605ef612..af93a1130cb 100644 --- a/source/blender/python/api2_2x/Camera.c +++ b/source/blender/python/api2_2x/Camera.c @@ -36,6 +36,7 @@ #include "BKE_utildefines.h" #include "BLI_blenlib.h" #include "BLI_arithb.h" /* for M_PI */ +#include "DNA_userdef_types.h" #include "BSE_editipo.h" #include "BIF_keyframing.h" #include "BIF_space.h" @@ -1032,18 +1033,21 @@ static PyObject *Camera_repr( BPy_Camera * self ) static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args ) { - int key = 0; + int key = 0, flag = 0; if( !PyArg_ParseTuple( args, "i", &( key ) ) ) return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "expected int argument" ) ); - + + /* flag should be initialised with the 'autokeying' flags like for normal keying */ + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; + if (key == IPOKEY_LENS){ - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, 0); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, flag); } else if (key == IPOKEY_CLIPPING){ - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, 0); - insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, 0); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, flag); + insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, flag); } allspace(REMAKEIPO, 0); |