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:
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index c63b32830b0..1d4edb45242 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -350,6 +350,12 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
PyObject* BL_ActionActuator::PyGetChannel(PyObject* value)
{
const char *string= _PyUnicode_AsString(value);
+
+ if (GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE)
+ {
+ PyErr_SetString(PyExc_NotImplementedError, "actuator.getChannel(): Only armatures support channels");
+ return NULL;
+ }
if (!string) {
PyErr_SetString(PyExc_TypeError, "expected a single string");
@@ -414,6 +420,12 @@ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
PyObject *pymat= NULL;
PyObject *pyloc= NULL, *pysize= NULL, *pyquat= NULL;
bPoseChannel *pchan;
+
+ if (GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE)
+ {
+ PyErr_SetString(PyExc_NotImplementedError, "actuator.setChannel(): Only armatures support channels");
+ return NULL;
+ }
if(PyTuple_Size(args)==2) {
if (!PyArg_ParseTuple(args,"sO:setChannel", &string, &pymat)) // matrix
@@ -574,6 +586,12 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA
PyObject *ret= PyList_New(0);
PyObject *item;
+ if (self->GetParent()->GetGameObjectType() != SCA_IObject::OBJ_ARMATURE)
+ {
+ PyErr_SetString(PyExc_NotImplementedError, "actuator.channelNames: Only armatures support channels");
+ return NULL;
+ }
+
bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose();
if(pose) {