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>2009-06-29 06:25:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-29 06:25:54 +0400
commitc50bbe5ae726edfb265bd54cb7ce0e547e3f4b31 (patch)
tree2fcb879d619b0794a7632575f64e5825949de4cf /source/gameengine/Converter
parentbb1f24ac443bcc386cf2cc3765609aaf9bf51db1 (diff)
BGE Py API using python3 c/api calls. include bpy_compat.h to support py2.x
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp12
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp8
2 files changed, 10 insertions, 10 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 1787909b064..d9e65c53fac 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -446,7 +446,7 @@ PyObject* BL_ActionActuator::PyGetAction(PyObject* args,
ShowDeprecationWarning("getAction()", "the action property");
if (m_action){
- return PyString_FromString(m_action->id.name+2);
+ return PyUnicode_FromString(m_action->id.name+2);
}
Py_RETURN_NONE;
}
@@ -796,7 +796,7 @@ PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args,
}
PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
- char *string= PyString_AsString(value);
+ char *string= _PyUnicode_AsString(value);
if (!string) {
PyErr_SetString(PyExc_TypeError, "expected a single string");
@@ -888,7 +888,7 @@ PyObject* BL_ActionActuator::PySetType(PyObject* args,
PyObject* BL_ActionActuator::PyGetContinue() {
ShowDeprecationWarning("getContinue()", "the continue property");
- return PyInt_FromLong((long)(m_end_reset==0));
+ return PyLong_FromSsize_t((long)(m_end_reset==0));
}
PyObject* BL_ActionActuator::PySetContinue(PyObject* value) {
@@ -1066,21 +1066,21 @@ PyAttributeDef BL_ActionActuator::Attributes[] = {
PyObject* BL_ActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
- return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
+ return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
}
int BL_ActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v);
- if (!PyString_Check(value))
+ if (!PyUnicode_Check(value))
{
PyErr_SetString(PyExc_ValueError, "actuator.action = val: Action Actuator, expected the string name of the action");
return PY_SET_ATTR_FAIL;
}
bAction *action= NULL;
- STR_String val = PyString_AsString(value);
+ STR_String val = _PyUnicode_AsString(value);
if (val != "")
{
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index b92e94b6e04..4c9a584d72b 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -486,7 +486,7 @@ const char BL_ShapeActionActuator::GetAction_doc[] =
PyObject* BL_ShapeActionActuator::PyGetAction() {
ShowDeprecationWarning("getAction()", "the action property");
if (m_action){
- return PyString_FromString(m_action->id.name+2);
+ return PyUnicode_FromString(m_action->id.name+2);
}
Py_RETURN_NONE;
}
@@ -845,21 +845,21 @@ PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) {
PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
- return PyString_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
+ return PyUnicode_FromString(self->GetAction() ? self->GetAction()->id.name+2 : "");
}
int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value)
{
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
/* exact copy of BL_ActionActuator's function from here down */
- if (!PyString_Check(value))
+ if (!PyUnicode_Check(value))
{
PyErr_SetString(PyExc_ValueError, "actuator.action = val: Shape Action Actuator, expected the string name of the action");
return PY_SET_ATTR_FAIL;
}
bAction *action= NULL;
- STR_String val = PyString_AsString(value);
+ STR_String val = _PyUnicode_AsString(value);
if (val != "")
{