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:
authorJacques Guignot <guignot@wanadoo.fr>2003-10-26 19:51:53 +0300
committerJacques Guignot <guignot@wanadoo.fr>2003-10-26 19:51:53 +0300
commit6b1b9c1890633fb45c7e1f826d2fb2cb491f68aa (patch)
tree6517462093e2a27570c8b661af49461cf7b380ad /source/blender/python/api2_2x/Camera.c
parente63a938c456f9edcd3d79857649cdd1a93364746 (diff)
iaccess to the IPOs of a Camera, a World, or of a Material
Diffstat (limited to 'source/blender/python/api2_2x/Camera.c')
-rw-r--r--source/blender/python/api2_2x/Camera.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Camera.c b/source/blender/python/api2_2x/Camera.c
index 645e1f08b00..01bb3f91075 100644
--- a/source/blender/python/api2_2x/Camera.c
+++ b/source/blender/python/api2_2x/Camera.c
@@ -246,8 +246,23 @@ Camera * GetCameraByName (char * name)
/*****************************************************************************/
/* Python BPy_Camera methods: */
/*****************************************************************************/
+
+
+#include <DNA_ipo_types.h>
+
+
+static PyObject *Camera_getIpo(BPy_Camera *self)
+{
+PyObject *Ipo_CreatePyObject (Ipo *ipo);
+ struct Ipo*ipo = self->camera->ipo;
+ if (!ipo) return EXPP_ReturnPyObjError(PyExc_RuntimeError,"Camera has no Ipo");
+ return Ipo_CreatePyObject (ipo);
+}
+
+
static PyObject *Camera_getName(BPy_Camera *self)
{
+
PyObject *attr = PyString_FromString(self->camera->id.name+2);
if (attr) return attr;
@@ -316,6 +331,23 @@ static PyObject *Camera_getDrawSize(BPy_Camera *self)
"couldn't get Camera.drawSize attribute");
}
+
+static PyObject *Camera_setIpo(BPy_Camera *self, PyObject *args)
+{
+int camera_assignIpo(Camera*,Ipo*);
+ PyObject *ipo = 0;
+ Ipo*ptr;
+ Ipo *Ipo_FromPyObject (PyObject *pyobj);
+
+ if (!PyArg_ParseTuple(args, "O", &ipo))
+ return EXPP_ReturnPyObjError (PyExc_TypeError,
+ "expected ipo argument");
+ptr = Ipo_FromPyObject(ipo);
+//camera_assignIpo(self->camera, ptr);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
static PyObject *Camera_setName(BPy_Camera *self, PyObject *args)
{
char *name;
@@ -502,6 +534,11 @@ static PyObject *Camera_getAttr (BPy_Camera *self, char *name)
{
PyObject *attr = Py_None;
+ if (strcmp(name, "ipo") == 0)
+ {
+ struct Ipo*ipo = self->camera->ipo;
+ if (ipo) attr = Ipo_CreatePyObject (ipo);
+ }
if (strcmp(name, "name") == 0)
attr = PyString_FromString(self->camera->id.name+2);
else if (strcmp(name, "type") == 0)