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-28 15:22:26 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-28 15:22:26 +0400
commit6b9f3b5f5c8d918585e01461a6202ae3df2df621 (patch)
tree655463247dee5167a8b7063bc6705eac84701bed /source/gameengine/Expressions
parent6998a0f47b673591f8561cda35d50e93979de32c (diff)
BGE Python API
Remove the last of the odd C++/python wrapper code from http://www.python.org/doc/PyCPP.html (~1998) * Use python subclasses rather then having fake subclassing through get/set attributes calling parent types. * PyObject getset arrays are created while initializing the types, converted from our own attribute arrays. This way python deals with subclasses and we dont have to define getattro or setattro functions for each type. * GameObjects and Scenes no longer have attribute access to properties. only dictionary style access - ob['prop'] * remove each class's get/set/dir functions. * remove isA() methods, can use PyObject_TypeCheck() in C and issubclass() in python. * remove Parents[] array for each C++ class, was only used for isA() and wasnt correct in quite a few cases. * remove PyTypeObject that was being passed as the last argument to each class (the parent classes too). TODO - * Light and VertexProxy need to be converted to using attributes. * memory for getset arrays is never freed, not that bad since its will only allocates once.
Diffstat (limited to 'source/gameengine/Expressions')
-rw-r--r--source/gameengine/Expressions/ListValue.cpp35
-rw-r--r--source/gameengine/Expressions/ListValue.h4
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp194
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h75
-rw-r--r--source/gameengine/Expressions/Value.cpp99
-rw-r--r--source/gameengine/Expressions/Value.h14
6 files changed, 60 insertions, 361 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp
index 59344ddb7b7..4cad4728521 100644
--- a/source/gameengine/Expressions/ListValue.cpp
+++ b/source/gameengine/Expressions/ListValue.cpp
@@ -289,25 +289,17 @@ PyTypeObject CListValue::Type = {
0, /*tp_hash*/
0, /*tp_call */
0,
- py_base_getattro,
- py_base_setattro,
+ NULL, //py_base_getattro,
+ NULL, //py_base_setattro,
0,
- Py_TPFLAGS_DEFAULT,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
0,0,0,0,0,0,0,
- Methods
-};
-
-
-
-PyParentObject CListValue::Parents[] = {
- &CListValue::Type,
- &CValue::Type,
- NULL
+ Methods,
+ 0,
+ 0,
+ &CValue::Type
};
-
-
-
PyMethodDef CListValue::Methods[] = {
/* List style access */
{"append", (PyCFunction)CListValue::sPyappend,METH_O},
@@ -329,21 +321,12 @@ PyAttributeDef CListValue::Attributes[] = {
{ NULL } //Sentinel
};
-PyObject* CListValue::py_getattro(PyObject* attr) {
- py_getattro_up(CValue);
-}
-
-PyObject* CListValue::py_getattro_dict() {
- py_getattro_dict_up(CValue);
-}
-
-
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-CListValue::CListValue(PyTypeObject *T )
-: CPropValue(T)
+CListValue::CListValue()
+: CPropValue()
{
m_bReleaseContents=true;
}
diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h
index 68e900e25e0..98e6f216f11 100644
--- a/source/gameengine/Expressions/ListValue.h
+++ b/source/gameengine/Expressions/ListValue.h
@@ -24,7 +24,7 @@ class CListValue : public CPropValue
//PLUGIN_DECLARE_SERIAL (CListValue,CValue)
public:
- CListValue(PyTypeObject *T = &Type);
+ CListValue();
virtual ~CListValue();
void AddConfigurationData(CValue* menuvalue);
@@ -60,8 +60,6 @@ public:
bool CheckEqual(CValue* first,CValue* second);
- virtual PyObject* py_getattro(PyObject* attr);
- virtual PyObject* py_getattro_dict();
virtual PyObject* py_repr(void) {
PyObject *py_proxy= this->GetProxy();
PyObject *py_list= PySequence_List(py_proxy);
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 2d4cc612aef..552e839d2b8 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -75,10 +75,15 @@ PyTypeObject PyObjectPlus::Type = {
0,
py_base_repr,
0,0,0,0,0,0,
- py_base_getattro,
- py_base_setattro,
- 0,0,0,0,0,0,0,0,0,
- Methods
+ NULL, //py_base_getattro,
+ NULL, //py_base_setattro,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ NULL // no subtype
};
@@ -105,9 +110,8 @@ void PyObjectPlus::py_base_dealloc(PyObject *self) // python wrapper
PyObject_DEL( self );
};
-PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor
+PyObjectPlus::PyObjectPlus() : SG_QList() // constructor
{
- MT_assert(T != NULL);
m_proxy= NULL;
};
@@ -115,77 +119,20 @@ PyObjectPlus::PyObjectPlus(PyTypeObject *T) : SG_QList() // constructor
* PyObjectPlus Methods -- Every class, even the abstract one should have a Methods
------------------------------*/
PyMethodDef PyObjectPlus::Methods[] = {
- {"isA", (PyCFunction) sPyisA, METH_O},
{NULL, NULL} /* Sentinel */
};
+#define attr_invalid (&(PyObjectPlus::Attributes[0]))
PyAttributeDef PyObjectPlus::Attributes[] = {
KX_PYATTRIBUTE_RO_FUNCTION("invalid", PyObjectPlus, pyattr_get_invalid),
{NULL} //Sentinel
};
-PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
- Py_RETURN_FALSE;
-}
-
-/*------------------------------
- * PyObjectPlus Parents -- Every class, even the abstract one should have parents
-------------------------------*/
-PyParentObject PyObjectPlus::Parents[] = {&PyObjectPlus::Type, NULL};
-
-/*------------------------------
- * PyObjectPlus attributes -- attributes
-------------------------------*/
-
-/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */
-PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr)
-{
- PyObjectPlus *self_plus= BGE_PROXY_REF(self);
- if(self_plus==NULL) {
- if(!strcmp("invalid", PyString_AsString(attr))) {
- Py_RETURN_TRUE;
- }
- PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG);
- return NULL;
- }
-
- PyObject *ret= self_plus->py_getattro(attr);
-
- /* Attribute not found, was this a __dict__ lookup?, otherwise set an error if none is set */
- if(ret==NULL) {
- char *attr_str= PyString_AsString(attr);
-
- if (strcmp(attr_str, "__dict__")==0)
- {
- /* the error string will probably not
- * be set but just incase clear it */
- PyErr_Clear();
- ret= self_plus->py_getattro_dict();
- }
- else if (!PyErr_Occurred()) {
- /* We looked for an attribute but it wasnt found
- * since py_getattro didnt set the error, set it here */
- PyErr_Format(PyExc_AttributeError, "'%s' object has no attribute '%s'", self->ob_type->tp_name, attr_str);
- }
- }
- return ret;
-}
-/* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */
-int PyObjectPlus::py_base_setattro(PyObject *self, PyObject *attr, PyObject *value)
-{
- PyObjectPlus *self_plus= BGE_PROXY_REF(self);
- if(self_plus==NULL) {
- PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG);
- return -1;
- }
-
- if (value==NULL)
- return self_plus->py_delattro(attr);
-
- return self_plus->py_setattro(attr, value);
+PyObject* PyObjectPlus::pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
+{
+ return PyBool_FromLong(self_v ? 1:0);
}
PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the entry in Type.
@@ -200,42 +147,19 @@ PyObject *PyObjectPlus::py_base_repr(PyObject *self) // This should be the ent
return self_plus->py_repr();
}
-PyObject *PyObjectPlus::py_getattro(PyObject* attr)
+/* note, this is called as a python 'getset, where the PyAttributeDef is the closure */
+PyObject *PyObjectPlus::py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef)
{
- PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
- if (descr == NULL) {
- return NULL; /* py_base_getattro sets the error, this way we can avoid setting the error at many levels */
- } else {
- /* Copied from py_getattro_up */
- if (PyCObject_Check(descr)) {
- return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr));
- } else if (descr->ob_type->tp_descr_get) {
- return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy);
- } else {
- return NULL;
- }
- /* end py_getattro_up copy */
- }
-}
-
-PyObject* PyObjectPlus::py_getattro_dict() {
- return py_getattr_dict(NULL, Type.tp_dict);
-}
+ void *self= (void *)(BGE_PROXY_REF(self_py));
+ if(self==NULL) {
+ if(attrdef == attr_invalid)
+ Py_RETURN_TRUE; // dont bother running the function
-int PyObjectPlus::py_delattro(PyObject* attr)
-{
- PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted");
- return 1;
-}
+ PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG);
+ return NULL;
+ }
-int PyObjectPlus::py_setattro(PyObject *attr, PyObject* value)
-{
- PyErr_SetString(PyExc_AttributeError, "attribute cant be set");
- return PY_SET_ATTR_MISSING;
-}
-PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef)
-{
if (attrdef->m_type == KX_PYATTRIBUTE_TYPE_DUMMY)
{
// fake attribute, ignore
@@ -355,8 +279,15 @@ PyObject *PyObjectPlus::py_get_attrdef(void *self, const PyAttributeDef *attrdef
}
}
-int PyObjectPlus::py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value)
+/* note, this is called as a python getset */
+int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef)
{
+ void *self= (void *)(BGE_PROXY_REF(self_py));
+ if(self==NULL) {
+ PyErr_SetString(PyExc_SystemError, BGE_PROXY_ERROR_MSG);
+ return PY_SET_ATTR_FAIL;
+ }
+
void *undoBuffer = NULL;
void *sourceBuffer = NULL;
size_t bufferSize = 0;
@@ -834,48 +765,6 @@ PyObject *PyObjectPlus::py_repr(void)
return NULL;
}
-/*------------------------------
- * PyObjectPlus isA -- the isA functions
-------------------------------*/
-bool PyObjectPlus::isA(PyTypeObject *T) // if called with a Type, use "typename"
-{
- int i;
- PyParentObject P;
- PyParentObject *Ps = GetParents();
-
- for (P = Ps[i=0]; P != NULL; P = Ps[i++])
- if (P==T)
- return true;
-
- return false;
-}
-
-
-bool PyObjectPlus::isA(const char *mytypename) // check typename of each parent
-{
- int i;
- PyParentObject P;
- PyParentObject *Ps = GetParents();
-
- for (P = Ps[i=0]; P != NULL; P = Ps[i++])
- if (strcmp(P->tp_name, mytypename)==0)
- return true;
-
- return false;
-}
-
-PyObject *PyObjectPlus::PyisA(PyObject *value) // Python wrapper for isA
-{
- if (PyType_Check(value)) {
- return PyBool_FromLong(isA((PyTypeObject *)value));
- } else if (PyString_Check(value)) {
- return PyBool_FromLong(isA(PyString_AsString(value)));
- }
- PyErr_SetString(PyExc_TypeError, "object.isA(value): expected a type or a string");
- return NULL;
-}
-
-
void PyObjectPlus::ProcessReplica()
{
/* Clear the proxy, will be created again if needed with GetProxy()
@@ -900,27 +789,6 @@ void PyObjectPlus::InvalidateProxy() // check typename of each parent
}
}
-/* Utility function called by the macro py_getattro_up()
- * for getting ob.__dict__() values from our PyObject
- * this is used by python for doing dir() on an object, so its good
- * if we return a list of attributes and methods.
- *
- * Other then making dir() useful the value returned from __dict__() is not useful
- * since every value is a Py_None
- * */
-PyObject *py_getattr_dict(PyObject *pydict, PyObject *tp_dict)
-{
- if(pydict==NULL) { /* incase calling __dict__ on the parent of this object raised an error */
- PyErr_Clear();
- pydict = PyDict_New();
- }
-
- PyDict_Update(pydict, tp_dict);
- return pydict;
-}
-
-
-
PyObject *PyObjectPlus::GetProxy_Ext(PyObjectPlus *self, PyTypeObject *tp)
{
if (self->m_proxy==NULL)
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 3b5eebe9893..0fe3e9f083d 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -155,41 +155,10 @@ typedef struct {
static PyTypeObject Type; \
static PyMethodDef Methods[]; \
static PyAttributeDef Attributes[]; \
- static PyParentObject Parents[]; \
virtual PyTypeObject *GetType(void) {return &Type;}; \
- virtual PyParentObject *GetParents(void) {return Parents;} \
virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \
virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \
-
-
-
- // This defines the py_getattro_up macro
- // which allows attribute and method calls
- // to be properly passed up the hierarchy.
- //
- // Note, PyDict_GetItem() WONT set an exception!
- // let the py_base_getattro function do this.
-
-#define py_getattro_up(Parent) \
- \
- PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
- \
- if(descr) { \
- if (PyCObject_Check(descr)) { \
- return py_get_attrdef((void *)this, (const PyAttributeDef*)PyCObject_AsVoidPtr(descr)); \
- } else if (descr->ob_type->tp_descr_get) { \
- return PyCFunction_New(((PyMethodDescrObject *)descr)->d_method, this->m_proxy); \
- } else { \
- return NULL; \
- } \
- } else { \
- return Parent::py_getattro(attr); \
- }
-
-#define py_getattro_dict_up(Parent) \
- return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict);
-
/*
* nonzero values are an error for setattr
* however because of the nested lookups we need to know if the errors
@@ -201,29 +170,6 @@ typedef struct {
#define PY_SET_ATTR_MISSING -1
#define PY_SET_ATTR_SUCCESS 0
-#define py_setattro_up(Parent) \
- PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
- \
- if(descr) { \
- if (PyCObject_Check(descr)) { \
- const PyAttributeDef* attrdef= reinterpret_cast<const PyAttributeDef *>(PyCObject_AsVoidPtr(descr)); \
- if (attrdef->m_access == KX_PYATTRIBUTE_RO) { \
- PyErr_Format(PyExc_AttributeError, "\"%s\" is read only", PyString_AsString(attr)); \
- return PY_SET_ATTR_FAIL; \
- } \
- else { \
- return py_set_attrdef((void *)this, attrdef, value); \
- } \
- } else { \
- PyErr_Format(PyExc_AttributeError, "\"%s\" cannot be set", PyString_AsString(attr)); \
- return PY_SET_ATTR_FAIL; \
- } \
- } else { \
- PyErr_Clear(); \
- return Parent::py_setattro(attr, value); \
- }
-
-
/**
* These macros are helpfull when embedding Python routines. The second
* macro is one that also requires a documentation string
@@ -493,7 +439,7 @@ class PyObjectPlus : public SG_QList
Py_Header; // Always start with Py_Header
public:
- PyObjectPlus(PyTypeObject *T);
+ PyObjectPlus();
PyObject *m_proxy; /* actually a PyObjectPlus_Proxy */
@@ -501,30 +447,17 @@ public:
/* These static functions are referenced by ALL PyObjectPlus_Proxy types
* they take the C++ reference from the PyObjectPlus_Proxy and call
- * its own virtual py_getattro, py_setattro etc. functions.
+ * its own virtual py_repr, py_base_dealloc ,etc. functions.
*/
static void py_base_dealloc(PyObject *self);
- static PyObject* py_base_getattro(PyObject * self, PyObject *attr);
- static int py_base_setattro(PyObject *self, PyObject *attr, PyObject *value);
static PyObject* py_base_repr(PyObject *self);
/* These are all virtual python methods that are defined in each class
* Our own fake subclassing calls these on each class, then calls the parent */
- virtual PyObject* py_getattro(PyObject *attr);
- virtual PyObject* py_getattro_dict();
- virtual int py_delattro(PyObject *attr);
- virtual int py_setattro(PyObject *attr, PyObject *value);
virtual PyObject* py_repr(void);
- static PyObject* py_get_attrdef(void *self, const PyAttributeDef *attrdef);
- static int py_set_attrdef(void *self, const PyAttributeDef *attrdef, PyObject *value);
-
- /* isA() methods, shonky replacement for pythons issubclass()
- * which we cant use because we have our own subclass system */
- bool isA(PyTypeObject *T);
- bool isA(const char *mytypename);
-
- KX_PYMETHOD_O(PyObjectPlus,isA);
+ static PyObject* py_get_attrdef(PyObject *self_py, const PyAttributeDef *attrdef);
+ static int py_set_attrdef(PyObject *self_py, PyObject *value, const PyAttributeDef *attrdef);
/* Kindof dumb, always returns True, the false case is checked for, before this function gets accessed */
static PyObject* pyattr_get_invalid(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp
index 61dabff510b..45eb15ecd08 100644
--- a/source/gameengine/Expressions/Value.cpp
+++ b/source/gameengine/Expressions/Value.cpp
@@ -54,15 +54,15 @@ PyTypeObject CValue::Type = {
py_base_repr,
0,
0,0,0,0,0,
- py_base_getattro,
- py_base_setattro,
- 0,0,0,0,0,0,0,0,0,
- Methods
-};
-
-PyParentObject CValue::Parents[] = {
- &CValue::Type,
- NULL
+ NULL, //py_base_getattro,
+ NULL, //py_base_setattro,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
+ 0,0,0,0,0,0,0,
+ Methods,
+ 0,
+ 0,
+ &PyObjectPlus::Type
};
PyMethodDef CValue::Methods[] = {
@@ -100,8 +100,8 @@ std::vector<SmartCValueRef> gRefList;
//int gRefCountValue;
#endif
-CValue::CValue(PyTypeObject *T)
- : PyObjectPlus(T),
+CValue::CValue()
+ : PyObjectPlus(),
#else
CValue::CValue()
:
@@ -553,30 +553,6 @@ PyAttributeDef CValue::Attributes[] = {
{ NULL } //Sentinel
};
-
-PyObject* CValue::py_getattro(PyObject *attr)
-{
- char *attr_str= PyString_AsString(attr);
- CValue* resultattr = GetProperty(attr_str);
- if (resultattr)
- {
- /* only show the wanting here because python inspects for __class__ and KX_MeshProxy uses CValues name attr */
- ShowDeprecationWarning("val = ob.attr", "val = ob['attr']");
-
- PyObject* pyconvert = resultattr->ConvertValueToPython();
-
- if (pyconvert)
- return pyconvert;
- else
- return resultattr->GetProxy();
- }
- py_getattro_up(PyObjectPlus);
-}
-
-PyObject* CValue::py_getattro_dict() {
- py_getattro_dict_up(PyObjectPlus);
-}
-
PyObject * CValue::pyattr_get_name(void * self_v, const KX_PYATTRIBUTE_DEF * attrdef) {
CValue * self = static_cast<CValue *> (self_v);
return PyString_FromString(self->GetName());
@@ -637,7 +613,7 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
} else
if (BGE_PROXY_CHECK_TYPE(pyobj)) /* Note, dont let these get assigned to GameObject props, must check elsewhere */
{
- if (BGE_PROXY_REF(pyobj) && (BGE_PROXY_REF(pyobj))->isA(&CValue::Type))
+ if (BGE_PROXY_REF(pyobj) && PyObject_TypeCheck(BGE_PROXY_REF(pyobj), &CValue::Type))
{
vallie = (static_cast<CValue *>(BGE_PROXY_REF(pyobj)))->AddRef();
} else {
@@ -656,57 +632,6 @@ CValue* CValue::ConvertPythonToValue(PyObject* pyobj, const char *error_prefix)
}
-int CValue::py_delattro(PyObject *attr)
-{
- ShowDeprecationWarning("del ob.attr", "del ob['attr']");
-
- char *attr_str= PyString_AsString(attr);
- if (RemoveProperty(attr_str))
- return 0;
-
- PyErr_Format(PyExc_AttributeError, "attribute \"%s\" dosnt exist", attr_str);
- return PY_SET_ATTR_MISSING;
-}
-
-int CValue::py_setattro(PyObject *attr, PyObject* pyobj)
-{
- ShowDeprecationWarning("ob.attr = val", "ob['attr'] = val");
-
- char *attr_str= PyString_AsString(attr);
- CValue* oldprop = GetProperty(attr_str);
- CValue* vallie;
-
- /* Dissallow python to assign GameObjects, Scenes etc as values */
- if ((BGE_PROXY_CHECK_TYPE(pyobj)==0) && (vallie = ConvertPythonToValue(pyobj, "cvalue.attr = value: ")))
- {
- if (oldprop)
- oldprop->SetValue(vallie);
- else
- SetProperty(attr_str, vallie);
-
- vallie->Release();
- }
- else {
- // ConvertPythonToValue sets the error message
- // must return missing so KX_GameObect knows this
- // attribute was not a function or bult in attribute,
- //
- // CValue attributes override internal attributes
- // so if it exists as a CValue attribute already,
- // assume your trying to set it to a differnt CValue attribute
- // otherwise return PY_SET_ATTR_MISSING so children
- // classes know they can set it without conflict
-
- if (GetProperty(attr_str))
- return PY_SET_ATTR_COERCE_FAIL; /* failed to set an existing attribute */
- else
- return PY_SET_ATTR_MISSING; /* allow the KX_GameObject dict to set */
- }
-
- //PyObjectPlus::py_setattro(attr,value);
- return PY_SET_ATTR_SUCCESS;
-};
-
PyObject* CValue::ConvertKeysToPython( void )
{
PyObject *pylist = PyList_New( 0 );
diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h
index 29ef19b46c9..9da75b96e78 100644
--- a/source/gameengine/Expressions/Value.h
+++ b/source/gameengine/Expressions/Value.h
@@ -215,26 +215,18 @@ public:
// Construction / Destruction
#ifndef NO_EXP_PYTHON_EMBEDDING
- CValue(PyTypeObject *T = &Type);
+ CValue();
//static PyObject* PyMake(PyObject*,PyObject*);
virtual PyObject *py_repr(void)
{
return PyString_FromString((const char*)GetText());
}
-
-
- virtual PyObject* py_getattro(PyObject *attr);
- virtual PyObject* py_getattro_dict();
virtual PyObject* ConvertValueToPython() {
return NULL;
}
virtual CValue* ConvertPythonToValue(PyObject* pyobj, const char *error_prefix);
-
-
- virtual int py_delattro(PyObject *attr);
- virtual int py_setattro(PyObject *attr, PyObject* value);
static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef);
@@ -417,8 +409,8 @@ class CPropValue : public CValue
public:
#ifndef NO_EXP_PYTHON_EMBEDDING
- CPropValue(PyTypeObject* T=&Type) :
- CValue(T),
+ CPropValue() :
+ CValue(),
#else
CPropValue() :
#endif //NO_EXP_PYTHON_EMBEDDING