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:
authorStephen Swaney <sswaney@centurytel.net>2004-12-17 20:34:51 +0300
committerStephen Swaney <sswaney@centurytel.net>2004-12-17 20:34:51 +0300
commit36abceed6bd9ee9123230521a14f8a81e7e83c85 (patch)
tree0124a05e4f826125640ffb289cd4efdf33ec760d
parentee810028b76618b5033e36242be25d38624488cc (diff)
bugfix: #2025 getCurveBP (and others) segfault
This method is now unsupported. The original intent appears to return the first BPoint of an Ipo curve. However, BPoint Ipo curves are not implemented and the first point therefore never existed. The segfault was from an unchecked input parameter. Calling this method now always throws a NotImplemented exception.
-rw-r--r--source/blender/python/api2_2x/Ipo.c18
-rw-r--r--source/blender/python/api2_2x/doc/Ipo.py10
2 files changed, 22 insertions, 6 deletions
diff --git a/source/blender/python/api2_2x/Ipo.c b/source/blender/python/api2_2x/Ipo.c
index b155e2a12e3..d254e43120f 100644
--- a/source/blender/python/api2_2x/Ipo.c
+++ b/source/blender/python/api2_2x/Ipo.c
@@ -1235,8 +1235,25 @@ static PyObject *Ipo_DeleteBezPoints( BPy_Ipo * self, PyObject * args )
}
+/*
+ * Ipo_getCurveBP()
+ * this method is UNSUPPORTED.
+ * Calling this method throws a TypeError Exception.
+ *
+ * it looks like the original intent was to return the first point
+ * of a BPoint Ipo curve. However, BPoint ipos are not currently
+ * implemented.
+ */
+
static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args )
{
+
+ /* unsupported method */
+ return EXPP_ReturnPyObjError( PyExc_NotImplementedError,
+ "bpoint ipos are not supported");
+
+#if 0
+
struct BPoint *ptrbpoint;
int num = 0, i;
IpoCurve *icu;
@@ -1265,6 +1282,7 @@ static PyObject *Ipo_getCurveBP( BPy_Ipo * self, PyObject * args )
for( i = 0; i < 4; i++ )
PyList_Append( l, PyFloat_FromDouble( ptrbpoint->vec[i] ) );
return l;
+#endif
}
static PyObject *Ipo_getCurveBeztriple( BPy_Ipo * self, PyObject * args )
diff --git a/source/blender/python/api2_2x/doc/Ipo.py b/source/blender/python/api2_2x/doc/Ipo.py
index 6fe0cfde406..cb3da597744 100644
--- a/source/blender/python/api2_2x/doc/Ipo.py
+++ b/source/blender/python/api2_2x/doc/Ipo.py
@@ -178,13 +178,11 @@ class Ipo:
def getCurveBP(curvepos):
"""
- Gets the basepoint of a curve of the ipo.
- @type curvepos: int
- @param curvepos: the position of the curve.
- @rtype: a list of 4 floats
- @return: the coordinates of the basepoint, or an error is raised.
+ This method is unsupported. BPoint Ipo curves are not implemented.
+ Calling this method throws a NotImplementedError exception.
+ @raise NotImplementedError: this method B{always} raises an exception
"""
-
+
def getBeztriple(curvepos,pointpos):
"""
Gets a beztriple of the Ipo.