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>2009-09-03 00:46:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-03 00:46:28 +0400
commite80b37cd751260232678ebd550aa5a0f2226b693 (patch)
tree1092d11b81cbab32c8bc5b76638d4dd3f0f018bd /source/gameengine/Ketsji/KX_PythonInit.cpp
parent21af438ef8c7cbc19ec0050195c3898ef4d95c29 (diff)
* KX_PythonSeq - comparisons work again. eg. act1.sensors == act2.sensors, had to copy Py_CmpToRich inline grr!, mailed python-dev about this.
* Shift-Click on states in the logic UI works again. * New Logic Space has all the view options pressed.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 67ab67814b2..667b4cd5d89 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -2018,4 +2018,42 @@ void resetGamePythonPath()
}
+/* Copied from pythons 3's Object.c
+ * also in blenders bpy_uitl.c, mailed the python-dev
+ * list about enabling something like this again for py3 */
+PyObject *
+Py_CmpToRich(int op, int cmp)
+{
+ PyObject *res;
+ int ok;
+
+ if (PyErr_Occurred())
+ return NULL;
+ switch (op) {
+ case Py_LT:
+ ok = cmp < 0;
+ break;
+ case Py_LE:
+ ok = cmp <= 0;
+ break;
+ case Py_EQ:
+ ok = cmp == 0;
+ break;
+ case Py_NE:
+ ok = cmp != 0;
+ break;
+ case Py_GT:
+ ok = cmp > 0;
+ break;
+ case Py_GE:
+ ok = cmp >= 0;
+ break;
+ default:
+ PyErr_BadArgument();
+ return NULL;
+ }
+ res = ok ? Py_True : Py_False;
+ Py_INCREF(res);
+ return res;
+}