[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12986] trunk/blender/source/blender/ python/api2_2x: patch from Vladimir Espinosa for keying object layers from python

Campbell Barton ideasman42 at gmail.com
Mon Dec 24 12:43:10 CET 2007


Revision: 12986
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12986
Author:   campbellbarton
Date:     2007-12-24 12:43:09 +0100 (Mon, 24 Dec 2007)

Log Message:
-----------
patch from Vladimir Espinosa for keying object layers from python

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Object.c
    trunk/blender/source/blender/python/api2_2x/doc/Object.py

Modified: trunk/blender/source/blender/python/api2_2x/Object.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Object.c	2007-12-24 10:25:35 UTC (rev 12985)
+++ trunk/blender/source/blender/python/api2_2x/Object.c	2007-12-24 11:43:09 UTC (rev 12986)
@@ -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 @@
 #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 @@
 
 /*
  * 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 @@
 		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 @@
 		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 @@
 	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 );

Modified: trunk/blender/source/blender/python/api2_2x/doc/Object.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Object.py	2007-12-24 10:25:35 UTC (rev 12985)
+++ trunk/blender/source/blender/python/api2_2x/doc/Object.py	2007-12-24 11:43:09 UTC (rev 12986)
@@ -105,6 +105,7 @@
 		- SIZE
 		- LOCROT
 		- LOCROTSIZE
+		- LAYER
 		- PI_STRENGTH
 		- PI_FALLOFF
 		- PI_SURFACEDAMP





More information about the Bf-blender-cvs mailing list