From 8fd81ab9e61e29aad78ebe3bcc6cc8741219f629 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 11 Feb 2011 00:03:26 +0000 Subject: BGE: frame start/end in action/fcurves/shapekey to support floats after discussion over the mailing-list it seems that it really makes no sense to restrict that. Specially since we have the "Property" playback mode that usually will be a float. Since there is no need for do_version or whatoever I don't see a problem. Any Thoughts? Maube to allow it only through the Python API? --- source/gameengine/Ketsji/KX_IpoActuator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/gameengine/Ketsji') diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 7bc85f5f262..d6ff1ee822e 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -456,16 +456,16 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { PyObject* KX_IpoActuator::pyattr_get_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_IpoActuator* self= static_cast(self_v); - return PyLong_FromDouble(self->m_startframe); + return PyFloat_FromDouble(self->m_startframe); } int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_IpoActuator* self= static_cast(self_v); - float param = PyLong_AsDouble(value); + float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { - PyErr_SetString(PyExc_AttributeError, "frameStart = integer: KX_IpoActuator, expected an integer value"); + PyErr_SetString(PyExc_AttributeError, "frameStart = float: KX_IpoActuator, expected a float value"); return PY_SET_ATTR_FAIL; } @@ -477,16 +477,16 @@ int KX_IpoActuator::pyattr_set_frame_start(void *self_v, const KX_PYATTRIBUTE_DE PyObject* KX_IpoActuator::pyattr_get_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_IpoActuator* self= static_cast(self_v); - return PyLong_FromDouble(self->m_endframe); + return PyFloat_FromDouble(self->m_endframe); } int KX_IpoActuator::pyattr_set_frame_end(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) { KX_IpoActuator* self= static_cast(self_v); - float param = PyLong_AsDouble(value); + float param = PyFloat_AsDouble(value); if (PyErr_Occurred()) { - PyErr_SetString(PyExc_AttributeError, "frameEnd = integer: KX_IpoActuator, expected an integer value"); + PyErr_SetString(PyExc_AttributeError, "frameEnd = float: KX_IpoActuator, expected a float value"); return PY_SET_ATTR_FAIL; } -- cgit v1.2.3