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:
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PropertyActuator.cpp')
-rw-r--r--source/gameengine/GameLogic/SCA_PropertyActuator.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
index 3b541e87f02..566d3b63487 100644
--- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
+++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp
@@ -245,17 +245,35 @@ PyParentObject SCA_PropertyActuator::Parents[] = {
};
PyMethodDef SCA_PropertyActuator::Methods[] = {
+ //Deprecated functions ------>
{"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (PY_METHODCHAR)SetProperty_doc},
{"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (PY_METHODCHAR)GetProperty_doc},
{"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (PY_METHODCHAR)SetValue_doc},
{"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (PY_METHODCHAR)GetValue_doc},
+ //<----- Deprecated
{NULL,NULL} //Sentinel
};
+PyAttributeDef SCA_PropertyActuator::Attributes[] = {
+ KX_PYATTRIBUTE_STRING_RW_CHECK("property",0,100,false,SCA_PropertyActuator,m_propname,CheckProperty),
+ KX_PYATTRIBUTE_STRING_RW("value",0,100,false,SCA_PropertyActuator,m_exprtxt),
+ { NULL } //Sentinel
+};
+
PyObject* SCA_PropertyActuator::_getattr(const STR_String& attr) {
+ PyObject* object = _getattr_self(Attributes, this, attr);
+ if (object != NULL)
+ return object;
_getattr_up(SCA_IActuator);
}
+int SCA_PropertyActuator::_setattr(const STR_String& attr, PyObject *value) {
+ int ret = _setattr_self(Attributes, this, attr, value);
+ if (ret >= 0)
+ return ret;
+ return SCA_IActuator::_setattr(attr, value);
+}
+
/* 1. setProperty */
const char SCA_PropertyActuator::SetProperty_doc[] =
"setProperty(name)\n"
@@ -264,6 +282,7 @@ const char SCA_PropertyActuator::SetProperty_doc[] =
"\tof this name, the call is ignored.\n";
PyObject* SCA_PropertyActuator::PySetProperty(PyObject* self, PyObject* args, PyObject* kwds)
{
+ ShowDeprecationWarning("setProperty()", "the 'property' property");
/* Check whether the name exists first ! */
char *nameArg;
if (!PyArg_ParseTuple(args, "s", &nameArg)) {
@@ -288,6 +307,7 @@ const char SCA_PropertyActuator::GetProperty_doc[] =
"\tReturn the property on which the actuator operates.\n";
PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* self, PyObject* args, PyObject* kwds)
{
+ ShowDeprecationWarning("getProperty()", "the 'property' property");
return PyString_FromString(m_propname);
}
@@ -300,6 +320,7 @@ const char SCA_PropertyActuator::SetValue_doc[] =
"\t action is ignored.\n";
PyObject* SCA_PropertyActuator::PySetValue(PyObject* self, PyObject* args, PyObject* kwds)
{
+ ShowDeprecationWarning("setValue()", "the value property");
char *valArg;
if(!PyArg_ParseTuple(args, "s", &valArg)) {
return NULL;
@@ -316,6 +337,7 @@ const char SCA_PropertyActuator::GetValue_doc[] =
"\tReturns the value with which the actuator operates.\n";
PyObject* SCA_PropertyActuator::PyGetValue(PyObject* self, PyObject* args, PyObject* kwds)
{
+ ShowDeprecationWarning("getValue()", "the value property");
return PyString_FromString(m_exprtxt);
}