diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2011-02-11 03:03:26 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2011-02-11 03:03:26 +0300 |
commit | 8fd81ab9e61e29aad78ebe3bcc6cc8741219f629 (patch) | |
tree | 1090096dd007e31def97e5edb1712260b0c9ec68 /source/gameengine/Ketsji/KX_IpoActuator.cpp | |
parent | 4612034cf45f2534b01bb038f80b7795e8b8e20d (diff) |
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?
Diffstat (limited to 'source/gameengine/Ketsji/KX_IpoActuator.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_IpoActuator.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<KX_IpoActuator*>(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<KX_IpoActuator*>(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<KX_IpoActuator*>(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<KX_IpoActuator*>(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; } |