Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-12-24 14:43:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-12-24 14:43:09 +0300
commit8a07e665c28a94ffd188daa431a4fd0c5a460eba (patch)
tree35584dd54a85fb0263d2634284a9a75c40f5a124 /source/blender/python/api2_2x/Object.c
parentdf46987ba3936b9f3a13f221cfbfc60696fef2bc (diff)
patch from Vladimir Espinosa for keying object layers from python
Diffstat (limited to 'source/blender/python/api2_2x/Object.c')
-rw-r--r--source/blender/python/api2_2x/Object.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index db8911cce2a..83c8ed7df3d 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -1,5 +1,5 @@
/*
- * $Id: Object.c 12801 2007-12-05 21:50:23Z blendix $
+ * $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
@@ -134,6 +134,7 @@ struct rctf;
#define IPOKEY_PI_SURFACEDAMP 8
#define IPOKEY_PI_RANDOMDAMP 9
#define IPOKEY_PI_PERM 10
+#define IPOKEY_LAYER 19
#define PFIELD_FORCE 1
#define PFIELD_VORTEX 2
@@ -2343,7 +2344,7 @@ static int Object_setMatrix( BPy_Object * self, MatrixObject * mat )
/*
* Object_insertIpoKey()
- * inserts Object IPO key for LOC, ROT, SIZE, LOCROT, or LOCROTSIZE
+ * inserts Object IPO key for LOC, ROT, SIZE, LOCROT, LOCROTSIZE, or LAYER
* Note it also inserts actions!
*/
@@ -2375,6 +2376,9 @@ static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args )
insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y, 0);
insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z, 0);
}
+ if (key == IPOKEY_LAYER ){
+ insertkey((ID *)ob, ID_OB, actname, NULL,OB_LAY, 0);
+ }
if (key == IPOKEY_PI_STRENGTH ){
insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR, 0);
@@ -5323,6 +5327,7 @@ static PyObject *M_Object_IpoKeyTypesDict( void )
PyConstant_Insert( d, "SIZE", PyInt_FromLong( IPOKEY_SIZE ) );
PyConstant_Insert( d, "LOCROT", PyInt_FromLong( IPOKEY_LOCROT ) );
PyConstant_Insert( d, "LOCROTSIZE", PyInt_FromLong( IPOKEY_LOCROTSIZE ) );
+ PyConstant_Insert( d, "LAYER", PyInt_FromLong( IPOKEY_LAYER ) );
PyConstant_Insert( d, "PI_STRENGTH", PyInt_FromLong( IPOKEY_PI_STRENGTH ) );
PyConstant_Insert( d, "PI_FALLOFF", PyInt_FromLong( IPOKEY_PI_FALLOFF ) );
@@ -5360,7 +5365,8 @@ PyObject *Object_Init( void )
PyModule_AddIntConstant( module, "SIZE", IPOKEY_SIZE );
PyModule_AddIntConstant( module, "LOCROT", IPOKEY_LOCROT );
PyModule_AddIntConstant( module, "LOCROTSIZE", IPOKEY_LOCROTSIZE );
-
+ PyModule_AddIntConstant( module, "LAYER", IPOKEY_LAYER );
+
PyModule_AddIntConstant( module, "PI_STRENGTH", IPOKEY_PI_STRENGTH );
PyModule_AddIntConstant( module, "PI_FALLOFF", IPOKEY_PI_FALLOFF );
PyModule_AddIntConstant( module, "PI_SURFACEDAMP", IPOKEY_PI_SURFACEDAMP );