From f5fc4ebdd8ede5263f4b34f161ebe139d40466dc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 19 Apr 2009 21:01:12 +0000 Subject: BGE Python API - More verbose error messages. - BL_Shader wasnt setting error messages on some errors - FilterNormal depth attribute was checking for float which is bad because scripts often expect ints assigned to float attributes. - Added a check to PyVecTo for a tuple rather then always using a generic python sequence. On my system this is over 2x faster with an optmized build. --- source/gameengine/VideoTexture/blendVideoTex.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/gameengine/VideoTexture/blendVideoTex.cpp') diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index ec066811a52..c11e7fffecd 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -1,6 +1,6 @@ /* $Id$ ----------------------------------------------------------------------------- -This source file is part of VideoTexure library +This source file is part of VideoTexture library Copyright (c) 2006 The Zdeno Ash Miklas @@ -49,14 +49,14 @@ static PyObject * getMaterialID (PyObject *self, PyObject *args) char * matName; // get parameters - if (!PyArg_ParseTuple(args, "Os", &obj, &matName)) + if (!PyArg_ParseTuple(args, "Os:materialID", &obj, &matName)) return NULL; // get material id short matID = getMaterialID(obj, matName); // if material was not found, report errot if (matID < 0) { - PyErr_SetString(PyExc_RuntimeError, "object doesn't have material with given name"); + PyErr_SetString(PyExc_RuntimeError, "VideoTexture.materialID(ob, string): Object doesn't have material with given name"); return NULL; } // return material ID @@ -67,7 +67,7 @@ static PyObject * getMaterialID (PyObject *self, PyObject *args) // get last error description static PyObject * getLastError (PyObject *self, PyObject *args) { - return Py_BuildValue("s", Exception::m_lastError.c_str()); + return PyString_FromString(Exception::m_lastError.c_str()); } // set log file @@ -89,7 +89,7 @@ static PyObject * imageToArray (PyObject * self, PyObject *args) if (!PyArg_ParseTuple(args, "O", &pyImg) || !pyImageTypes.in(pyImg->ob_type)) { // if object is incorect, report error - PyErr_SetString(PyExc_TypeError, "The value must be a image source object"); + PyErr_SetString(PyExc_TypeError, "VideoTexture.imageToArray(image): The value must be a image source object"); return NULL; } // get image structure -- cgit v1.2.3