Page Menu
Home
Search
Configure Global Search
Log In
Files
F1520
Object.c.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Johnny Matthews (guitargeek)
Nov 13 2013, 12:58 PM
Size
3 KB
Subscribers
None
Object.c.patch
View Options
Index: source/blender/python/api2_2x/Object.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Object.c,v
retrieving revision 1.101
diff -u -r1.101 Object.c
--- source/blender/python/api2_2x/Object.c 12 Mar 2005 11:38:51 -0000 1.101
+++ source/blender/python/api2_2x/Object.c 18 Mar 2005 16:44:55 -0000
@@ -58,6 +58,17 @@
#include <string.h>
+
+/* Defines for insertIpoKey */
+
+#define IPOKEY_LOC 0
+#define IPOKEY_ROT 1
+#define IPOKEY_SIZE 2
+#define IPOKEY_LOCROT 3
+#define IPOKEY_LOCROTSIZE 4
+
+
+
/*****************************************************************************/
/* Python API function prototypes for the Blender module. */
/*****************************************************************************/
@@ -141,6 +152,7 @@
static PyObject *Object_setEuler( BPy_Object * self, PyObject * args );
static PyObject *Object_setMatrix( BPy_Object * self, PyObject * args );
static PyObject *Object_setIpo( BPy_Object * self, PyObject * args );
+static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args );
static PyObject *Object_setLocation( BPy_Object * self, PyObject * args );
static PyObject *Object_setMaterials( BPy_Object * self, PyObject * args );
static PyObject *Object_setName( BPy_Object * self, PyObject * args );
@@ -288,9 +300,11 @@
"( 1 or 0 ) - Set the selected state of the object.\n\
1 is selected, 0 not selected "},
{"setIpo", ( PyCFunction ) Object_setIpo, METH_VARARGS,
- "(Blender Ipo) - Sets the object's ipo"},
+ "(Blender Ipo) - Sets the object's ipo"},
{"clearIpo", ( PyCFunction ) Object_clearIpo, METH_NOARGS,
"() - Unlink ipo from this object"},
+ {"insertIpoKey", ( PyCFunction ) Object_insertIpoKey, METH_VARARGS,
+ "(Blender Ipo) - Inserts a key into IPO"},
{"getAllProperties", ( PyCFunction ) Object_getAllProperties,
METH_NOARGS,
"() - Get all the properties from this object"},
@@ -597,6 +611,12 @@
module = Py_InitModule3( "Blender.Object", M_Object_methods,
M_Object_doc );
+ PyModule_AddIntConstant( module, "LOC", 0 );
+ PyModule_AddIntConstant( module, "ROT", 1 );
+ PyModule_AddIntConstant( module, "SIZE", 2 );
+ PyModule_AddIntConstant( module, "LOCROT", 3 );
+ PyModule_AddIntConstant( module, "LOCROTSIZE", 4 );
+
return ( module );
}
@@ -1545,6 +1565,42 @@
Py_INCREF( Py_None );
return Py_None;
}
+
+static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args )
+{
+ int key = 0;
+
+ if( !PyArg_ParseTuple( args, "i", &( key ) ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected int argument" ) );
+
+ if (key == IPOKEY_LOC || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
+ insertkey((ID *)self->object,OB_LOC_X);
+ insertkey((ID *)self->object,OB_LOC_Y);
+ insertkey((ID *)self->object,OB_LOC_Z);
+ }
+ if (key == IPOKEY_ROT || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
+ insertkey((ID *)self->object,OB_ROT_X);
+ insertkey((ID *)self->object,OB_ROT_Y);
+ insertkey((ID *)self->object,OB_ROT_Z);
+ }
+ if (key == IPOKEY_SIZE || key == IPOKEY_LOCROTSIZE ){
+ insertkey((ID *)self->object,OB_SIZE_X);
+ insertkey((ID *)self->object,OB_SIZE_Y);
+ insertkey((ID *)self->object,OB_SIZE_Z);
+ }
+
+ allspace(REMAKEIPO, 0);
+ allqueue(REDRAWIPO, 0);
+ allqueue(REDRAWVIEW3D, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWNLA, 0);
+
+ Py_INCREF( Py_None );
+ return Py_None;
+}
+
+
static PyObject *Object_setLocation( BPy_Object * self, PyObject * args )
{
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fc/18/505d82b5e9dc40cda14a848fe706
Event Timeline
Log In to Comment