diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-04-05 18:01:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-04-05 18:01:49 +0400 |
commit | 033a63f8580227582a9695ebdd78ac0b4322e867 (patch) | |
tree | 61517f343a2908f894d54c46269baa5c54338135 /source/gameengine/Ketsji/KX_PolygonMaterial.h | |
parent | 7d4dc4f0f5d34d91703b2219323ef4a3db28a572 (diff) |
BGE Bugfixes (mostly in the py api)
KX_PolygonMaterial and KX_BlenderMaterial - Added a print function (would raise a python error on printing)
* Crashes *
KX_GameObject SetParent - Disallowed setting a parent to its self, caused a recursion crash.
KX_MeshProxy "materials" attribute was segfaulting because of my recent change - I was wrong, you do need to check material types (no idea why since they are both PyObject * at the base)
KX_VisibilityActuator - Wasn't initialized with PyType_Ready() making it crash on access (own fault)
* Crashes because of missing NULL checks *
KX_PolygonMaterial's "gl_texture" attribute wasnt checking for a valid m_tface
KX_GameObject - added checks for GetPhysicsController()
KX_RayCast::RayTest - didnt check for a valid physics_environment
KX_SceneActuator's getCamera python function wasnt checking if there was a camera.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PolygonMaterial.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_PolygonMaterial.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 1e8ce5c3367..9865a66e836 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -33,6 +33,7 @@ #include "RAS_MaterialBucket.h" #include "RAS_IRasterizer.h" +#include "DNA_ID.h" struct MTFace; struct Material; @@ -117,7 +118,7 @@ public: virtual PyObject* py_getattro(PyObject *attr); virtual int py_setattro(PyObject *attr, PyObject *pyvalue); - + virtual PyObject* py_repr(void) { return PyString_FromString(m_material ? ((ID *)m_material)->name+2 : ""); } static PyObject* pyattr_get_texture(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_material(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); |