Page MenuHome

Camera.c.patch

Camera.c.patch

Index: source/blender/python/api2_2x/Camera.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Camera.c,v
retrieving revision 1.31
diff -u -r1.31 Camera.c
--- source/blender/python/api2_2x/Camera.c 9 Mar 2005 19:45:55 -0000 1.31
+++ source/blender/python/api2_2x/Camera.c 21 Mar 2005 20:03:00 -0000
@@ -25,7 +25,7 @@
*
* This is a new part of Blender.
*
- * Contributor(s): Willian P. Germano
+ * Contributor(s): Willian P. Germano, Johnny Matthews
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
@@ -35,16 +35,22 @@
#include <BKE_object.h>
#include <BKE_library.h>
#include <BLI_blenlib.h>
+#include <BIF_editview.h>
+#include <BSE_editipo.h>
#include <Python.h>
#include "constant.h"
#include "gen_utils.h"
+#include "modules.h"
#include "Camera.h"
#include "Ipo.h"
+
+#define IPOKEY_LENS 0
+#define IPOKEY_CLIPPING 1
/*****************************************************************************/
/* Python API function prototypes for the Camera module. */
/*****************************************************************************/
@@ -119,6 +125,7 @@
static PyObject *Camera_getScriptLinks( BPy_Camera * self, PyObject * args );
static PyObject *Camera_addScriptLink( BPy_Camera * self, PyObject * args );
static PyObject *Camera_clearScriptLinks( BPy_Camera * self );
+static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args );
Camera *GetCameraByName( char *name );
@@ -151,6 +158,8 @@
"(Blender Ipo) - Set Camera Ipo"},
{"clearIpo", ( PyCFunction ) Camera_clearIpo, METH_NOARGS,
"() - Unlink Ipo from this Camera."},
+ {"insertIpoKey", ( PyCFunction ) Camera_insertIpoKey, METH_VARARGS,
+ "( Camera IPO type ) - Inserts a key into IPO"},
{"setName", ( PyCFunction ) Camera_setName, METH_VARARGS,
"(s) - Set Camera Data name"},
{"setType", ( PyCFunction ) Camera_setType, METH_VARARGS,
@@ -347,6 +356,9 @@
submodule = Py_InitModule3( "Blender.Camera",
M_Camera_methods, M_Camera_doc );
+ PyModule_AddIntConstant( submodule, "LENS", IPOKEY_LENS );
+ PyModule_AddIntConstant( submodule, "CLIPPING", IPOKEY_CLIPPING );
+
return submodule;
}
@@ -941,4 +953,34 @@
{
return PyString_FromFormat( "[Camera \"%s\"]",
self->camera->id.name + 2 );
+}
+
+/*
+ * Camera_insertIpoKey()
+ * inserts Camera IPO key for LENS and CLIPPING
+ */
+
+static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args )
+{
+ int key = 0;
+
+ if( !PyArg_ParseTuple( args, "i", &( key ) ) )
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "expected int argument" ) );
+
+ if (key == IPOKEY_LENS){
+ insertkey((ID *)self->camera, CAM_LENS);
+ }
+ else if (key == IPOKEY_CLIPPING){
+ insertkey((ID *)self->camera, CAM_STA);
+ insertkey((ID *)self->camera, CAM_END);
+ }
+
+ allspace(REMAKEIPO, 0);
+ EXPP_allqueue(REDRAWIPO, 0);
+ EXPP_allqueue(REDRAWVIEW3D, 0);
+ EXPP_allqueue(REDRAWACTION, 0);
+ EXPP_allqueue(REDRAWNLA, 0);
+
+ return EXPP_incr_ret( Py_None );
}

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a0/7f/af5c3813339fa84d536aa0b0b856

Event Timeline