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>2008-09-03 10:43:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-09-03 10:43:07 +0400
commitcfa07e8d2bdc0a8db15082a692ce25c2fb010ae6 (patch)
tree91d652fffe244c607c022a45569556840be81a9a /source/gameengine/Ketsji/KX_GameObject.cpp
parentb818b1a16496b6c68443f8cfd56079df201560cf (diff)
BGE Py api, deleting properties didnt raise an error when the property wasnt there. also added some exception messages and renamed joystick getConnected() to isConnected()
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index c1b228e8d26..cc2956813c1 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -1036,11 +1036,15 @@ PyObject* KX_GameObject::_getattr(const STR_String& attr)
int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr method
{
- if (attr == "mass")
+ if (attr == "mass") {
+ PyErr_SetString(PyExc_AttributeError, "attribute \"mass\" is read only");
return 1;
+ }
- if (attr == "parent")
+ if (attr == "parent") {
+ PyErr_SetString(PyExc_AttributeError, "attribute \"mass\" is read only\nUse setParent()");
return 1;
+ }
if (PyInt_Check(value))
{
@@ -1106,7 +1110,7 @@ int KX_GameObject::_setattr(const STR_String& attr, PyObject *value) // _setattr
}
return 1;
}
-
+ PyErr_SetString(PyExc_AttributeError, "could not set the orientation from a 3x3 matrix, quaternion or euler sequence");
return 1;
}