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-03-14 06:01:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2007-03-14 06:01:24 +0300
commit5c5a80f6443e97eb38717b108e7797589dda34d7 (patch)
treed99416d0b1e0a1ef68267faeb0ec55408dc289a8 /source/blender/python/api2_2x/Ipo.c
parentd3ae4b9944c17e14a489255901a32dc8a77246e5 (diff)
made all python types that can do .__copy__(), also do .copy()
added copy function to lamp, texture and ipo types
Diffstat (limited to 'source/blender/python/api2_2x/Ipo.c')
-rw-r--r--source/blender/python/api2_2x/Ipo.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
index 8bbcc1dce6b..4c65f31cfe3 100644
--- a/source/blender/python/api2_2x/Ipo.c
+++ b/source/blender/python/api2_2x/Ipo.c
@@ -36,6 +36,7 @@
#include "BKE_main.h"
#include "BKE_global.h"
#include "BKE_library.h"
+#include "BKE_object.h"
#include "BKE_ipo.h"
#include "BLI_blenlib.h"
#include "BIF_space.h"
@@ -115,6 +116,7 @@ static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args );
static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args );
static PyObject *Ipo_getChannel( BPy_Ipo * self );
+static PyObject *Ipo_copy( BPy_Ipo * self );
static int Ipo_setChannel( BPy_Ipo * self, PyObject * args );
static int Ipo_length( BPy_Ipo * inst );
@@ -164,6 +166,12 @@ static PyMethodDef BPy_Ipo_methods[] = {
"(int,int) - deprecated: see ipocurve.bezierPoints[]"},
{"setCurveBeztriple", ( PyCFunction ) Ipo_setCurveBeztriple, METH_VARARGS,
"(int,int,list) - set a BezTriple"},
+
+ {"__copy__", ( PyCFunction ) Ipo_copy, METH_NOARGS,
+ "() - copy the ipo"},
+ {"copy", ( PyCFunction ) Ipo_copy, METH_NOARGS,
+ "() - copy the ipo"},
+
{NULL, NULL, 0, NULL}
};
@@ -1761,6 +1769,14 @@ static PyObject *Ipo_setCurveBeztriple( BPy_Ipo * self, PyObject * args )
return Py_None;
}
+/* Ipo.__copy__ */
+static PyObject *Ipo_copy( BPy_Ipo * self )
+{
+ Ipo *ipo = copy_ipo(self->ipo );
+ ipo->id.us = 0;
+ return Ipo_CreatePyObject(ipo);
+}
+
static PyObject *Ipo_EvaluateCurveOn( BPy_Ipo * self, PyObject * args )
{
int num = 0, i;