diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-09 00:08:19 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-09 00:08:19 +0400 |
commit | c8b4cf92067ffeb625aa39003baf5d8f7c3f0025 (patch) | |
tree | c6c50dbc3d90a65fca6c1ca56a93e4a57cf7e154 /source/gameengine/Ketsji/KX_PyMath.h | |
parent | e93db433a086a3e739c0f4026cd500f0b595b0f1 (diff) | |
parent | d76a6f5231c015c35123d22e1f5c3ffcdfbf9bbd (diff) |
2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD
Notes:
* Game and sequencer RNA, and sequencer header are now out of date
a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
not needed anymore.
* Fix "duplicate strip" always increase the user count for ipo.
* IPO pinning on sequencer strips was lost during Undo.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PyMath.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_PyMath.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 00f7c5cad93..a7ce4bc6930 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -40,6 +40,7 @@ #include "MT_Matrix4x4.h" #include "KX_Python.h" +#include "PyObjectPlus.h" inline unsigned int Size(const MT_Matrix4x4&) { return 4; } inline unsigned int Size(const MT_Matrix3x3&) { return 3; } @@ -116,6 +117,19 @@ bool PyVecTo(PyObject* pyval, T& vec) return true; } + else if (BGE_PROXY_CHECK_TYPE(pyval)) + { /* note, include this check because PySequence_Check does too much introspection + * on the PyObject (like getting its __class__, on a BGE type this means searching up + * the parent list each time only to discover its not a sequence. + * GameObjects are often used as an alternative to vectors so this is a common case + * better to do a quick check for it, likely the error below will be ignored. + * + * This is not 'correct' since we have proxy type CListValues's which could + * contain floats/ints but there no cases of CValueLists being this way + */ + PyErr_Format(PyExc_AttributeError, "expected a sequence type"); + return false; + } else if (PySequence_Check(pyval)) { unsigned int numitems = PySequence_Size(pyval); |