BGE Python API
authorCampbell Barton <ideasman42@gmail.com>
Mon, 20 Apr 2009 23:17:52 +0000 (23:17 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 20 Apr 2009 23:17:52 +0000 (23:17 +0000)
Separate getting a normal attribute and getting __dict__, was having to do too a check for __dict__ on each class (multiple times per getattro call from python) when its not used that often.

123 files changed:
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ActionActuator.h
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_ShapeActionActuator.h
source/gameengine/Expressions/ListValue.cpp
source/gameengine/Expressions/ListValue.h
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_2DFilterActuator.h
source/gameengine/GameLogic/SCA_ANDController.cpp
source/gameengine/GameLogic/SCA_ANDController.h
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_ActuatorSensor.h
source/gameengine/GameLogic/SCA_AlwaysSensor.cpp
source/gameengine/GameLogic/SCA_AlwaysSensor.h
source/gameengine/GameLogic/SCA_DelaySensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.h
source/gameengine/GameLogic/SCA_ExpressionController.h
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_IObject.cpp
source/gameengine/GameLogic/SCA_IObject.h
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/GameLogic/SCA_NANDController.cpp
source/gameengine/GameLogic/SCA_NANDController.h
source/gameengine/GameLogic/SCA_NORController.cpp
source/gameengine/GameLogic/SCA_NORController.h
source/gameengine/GameLogic/SCA_ORController.cpp
source/gameengine/GameLogic/SCA_ORController.h
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.h
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PropertySensor.h
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomActuator.h
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SCA_RandomSensor.h
source/gameengine/GameLogic/SCA_XNORController.cpp
source/gameengine/GameLogic/SCA_XNORController.h
source/gameengine/GameLogic/SCA_XORController.cpp
source/gameengine/GameLogic/SCA_XORController.h
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_CDActuator.cpp
source/gameengine/Ketsji/KX_CDActuator.h
source/gameengine/Ketsji/KX_Camera.cpp
source/gameengine/Ketsji/KX_Camera.h
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.h
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_ConstraintWrapper.h
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameActuator.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_IpoActuator.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_Light.h
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MeshProxy.h
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_NearSensor.h
source/gameengine/Ketsji/KX_ObjectActuator.cpp
source/gameengine/Ketsji/KX_ObjectActuator.h
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_ParentActuator.h
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PolyProxy.h
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.h
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RadarSensor.h
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_RaySensor.h
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp
source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_SceneActuator.h
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_SoundActuator.h
source/gameengine/Ketsji/KX_StateActuator.cpp
source/gameengine/Ketsji/KX_StateActuator.h
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TouchSensor.h
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.h
source/gameengine/Ketsji/KX_VehicleWrapper.cpp
source/gameengine/Ketsji/KX_VehicleWrapper.h
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Ketsji/KX_VertexProxy.h
source/gameengine/Ketsji/KX_VisibilityActuator.cpp
source/gameengine/Ketsji/KX_VisibilityActuator.h

index 7515f3f5f918769ae75bc318afad5a59b69de7ec..3002005ae3f5db3279270b4c519d4043789964a9 100644 (file)
@@ -1020,6 +1020,10 @@ PyObject* BL_ActionActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* BL_ActionActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int BL_ActionActuator::py_setattro(PyObject *attr, PyObject* value) {
        py_setattro_up(SCA_IActuator);
 }
index 6ae7f716b4b25315e529b39fe548e3b39b82371d..b3c15c08f506cc62a607c0105df67b952e78e9bc 100644 (file)
@@ -114,6 +114,7 @@ public:
        KX_PYMETHOD_DOC(BL_ActionActuator,setChannel);
 
        virtual PyObject* py_getattro(PyObject* attr);
+       virtual PyObject*               py_getattro_dict();
        virtual int py_setattro(PyObject* attr, PyObject* value);
 
        static PyObject*        pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index 62bc99bb437472bdf8f2f0fcaa29474320d2fd26..a447ffb8aa949676a4926adcbc1b12e7a2941285 100644 (file)
@@ -489,6 +489,10 @@ PyObject* BL_ShapeActionActuator::py_getattro(PyObject* attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* BL_ShapeActionActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int BL_ShapeActionActuator::py_setattro(PyObject *attr, PyObject* value) {
        py_setattro_up(SCA_IActuator);
 }
index 3bc35ac949520c7c12756f48800d7e93ddd83b84..d268eef6d23c73ae6372d2815a7fddf78daee007 100644 (file)
@@ -107,6 +107,7 @@ public:
        KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType);
 
        virtual PyObject* py_getattro(PyObject* attr);
+       virtual PyObject*               py_getattro_dict();
        virtual int py_setattro(PyObject* attr, PyObject* value);
 
        static PyObject*        pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index dd9b296dce12985e692f0556747d4c49cf930701..7c31a29f4ac271db270bf28060afc79148985499 100644 (file)
@@ -273,6 +273,10 @@ PyObject* CListValue::py_getattro(PyObject* attr) {
        py_getattro_up(CValue);
 }
 
+PyObject* CListValue::py_getattro_dict() {
+       py_getattro_dict_up(CValue);
+}
+
 
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
index 2af5a330c4366dbbb6fedce8bb0dec49ed7af127..3d88b5aea9c8ba943b302e98b93dd0806d7aad48 100644 (file)
@@ -60,6 +60,7 @@ 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);
index 6cfa14ddc80dc1fb1244235562e87c479fa960e4..c4daaff2dd1fa5c9d688cb15c9ce7ea11dd4e193 100644 (file)
@@ -143,7 +143,13 @@ PyObject *PyObjectPlus::py_base_getattro(PyObject * self, PyObject *attr)
                PyErr_SetString(PyExc_RuntimeError, BGE_PROXY_ERROR_MSG);
                return NULL;
        }
-       return self_plus->py_getattro(attr); 
+       
+       PyObject *ret= self_plus->py_getattro(attr);
+       
+       if(ret==NULL && (strcmp(PyString_AsString(attr), "__dict__")==0))
+               ret= self_plus->py_getattro_dict();
+       
+       return ret;
 }
 
 /* This should be the entry in Type since it takes the C++ class from PyObjectPlus_Proxy */
@@ -177,9 +183,6 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr)
 {
        PyObject *descr = PyDict_GetItem(Type.tp_dict, attr); \
        if (descr == NULL) {
-               if (strcmp(PyString_AsString(attr), "__dict__")==0) {
-                       return py_getattr_dict(NULL, Type.tp_dict); /* no Attributes yet */
-               }
                PyErr_Format(PyExc_AttributeError, "attribute \"%s\" not found", PyString_AsString(attr));
                return NULL;
        } else {
@@ -196,6 +199,10 @@ PyObject *PyObjectPlus::py_getattro(PyObject* attr)
        }
 }
 
+PyObject* PyObjectPlus::py_getattro_dict() {
+       return py_getattr_dict(NULL, Type.tp_dict);
+}
+
 int PyObjectPlus::py_delattro(PyObject* attr)
 {
        PyErr_SetString(PyExc_AttributeError, "attribute cant be deleted");
index 370717a919bf536a0e01b0d2789c6c44b72adc10..b0ddfa04e3284eeb2444c1db43916935a1f6a582 100644 (file)
@@ -130,16 +130,12 @@ typedef struct {
                } \
        } else { \
                PyErr_Clear(); \
-               PyObject *rvalue= Parent::py_getattro(attr); \
-                \
-               if (strcmp(PyString_AsString(attr), "__dict__")==0) { \
-                       return py_getattr_dict(rvalue, Type.tp_dict); \
-               } \
-                \
-               return rvalue; \
+               return Parent::py_getattro(attr); \
        } \
        return NULL;
 
+#define py_getattro_dict_up(Parent) \
+       return py_getattr_dict(Parent::py_getattro_dict(), Type.tp_dict);
 
 /*
  * nonzero values are an error for setattr
@@ -434,6 +430,7 @@ public:
        /* 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);
index 7cb9790911901af3c5f2477b9f769d620c0a3548..106bd1256a6331440ec65d0c1310f3fd6ab50c14 100644 (file)
@@ -612,6 +612,10 @@ PyObject*  CValue::py_getattro(PyObject *attr)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* CValue::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 CValue* CValue::ConvertPythonToValue(PyObject* pyobj)
 {
 
index a687e1a493cbe252278c4a22dcb2ff03e1423926..88186fa95c041c4c6dee79b4bd175ba4be42cc55 100644 (file)
@@ -225,6 +225,7 @@ public:
 
 
        virtual PyObject*                       py_getattro(PyObject *attr);
+       virtual PyObject*                       py_getattro_dict();
        virtual PyObject*       ConvertValueToPython() {
                return NULL;
        }
index 251a586308ec87a110d803402137dbcc8841dd19..9bf03bf39cc8670454469f77429b455e278cd7c3 100644 (file)
@@ -157,6 +157,10 @@ PyObject* SCA_2DFilterActuator::py_getattro(PyObject *attr)
     py_getattro_up(SCA_IActuator);
 }
 
+PyObject* SCA_2DFilterActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int SCA_2DFilterActuator::py_setattro(PyObject *attr, PyObject* value) 
 {
        py_setattro_up(SCA_IActuator);
index de0201a4b1967b443ed4ce897d261329b20aa678..b43dc092ddb9e8de381f6d37f90bba9a630a936f 100644 (file)
@@ -71,6 +71,7 @@ public:
        /* --------------------------------------------------------------------- */
 
     virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
 };
index 1cb03f375cb850c218f9ac830bd2b98e11d04275..e4642750942423464457049728df9130a4c28981 100644 (file)
@@ -145,4 +145,8 @@ PyObject* SCA_ANDController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_ANDController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index fdb93d0fc4290dad8609a66a085a2e709e1e6ec3..9a359d57cb407864e80b0987f1ec666e4803019a 100644 (file)
@@ -49,6 +49,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
 };
 
index acd906ef9ddaedf245f9172a9546043548c9ed37..4c85c4f8e5e9c78c0f3f4dd2b825f1c4dba7cf1d 100644 (file)
@@ -165,6 +165,10 @@ PyObject* SCA_ActuatorSensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_ActuatorSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_ActuatorSensor::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_ISensor);
 }
index 21960993497c90358fee424d43ec8074a6efd794..974b2e43d7831bc29a0038118e1a2ea33577f36d 100644 (file)
@@ -62,6 +62,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* 3. setProperty */
index b7ecb0233a1c3ae13af5f2f99f8fe3b8f560716b..874883c89b10743ee259902fb7a7093440dbb310 100644 (file)
@@ -143,4 +143,8 @@ PyObject* SCA_AlwaysSensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_AlwaysSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 /* eof */
index 87949babf595310662bf8f1eb8fa2996e32c9043..769e1e883bc93f7f22363b0af53ec853ee47a858 100644 (file)
@@ -53,7 +53,7 @@ public:
        /* --------------------------------------------------------------------- */
        
        virtual PyObject* py_getattro(PyObject *attr);
-
+       virtual PyObject* py_getattro_dict();
        
 };
 
index 44a0175d916982445e5a7a094c96eae616a3fb79..0e4a00e27459d13d646558c8a212006425e2ec2b 100644 (file)
@@ -182,6 +182,10 @@ PyObject* SCA_DelaySensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_DelaySensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_DelaySensor::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_ISensor);
 }
index 8da76ff7189c49d4a0909c2183b6c328ad25a0a0..31394fdc9615b5baf623983d08b501d146cc4322 100644 (file)
@@ -61,6 +61,7 @@ public:
        /* --------------------------------------------------------------------- */
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject*               py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* setProperty */
index 2936742be19e4875a0c29954dd81f22c3bb9465e..6a34d7b2dff9e8959425e3ad921bda2b008c97e6 100644 (file)
@@ -60,6 +60,7 @@ public:
        /* --------------------------------------------------------------------- */
 
 //     virtual PyObject* py_getattro(PyObject *attr);
+//     virtual PyObject* py_getattro_dict();
 
 };
 
index 3cd750ff63b2ec200288e53760298b0166294b88..02a25916299ac22ad4d10cc0c42b3528c7c0dc05 100644 (file)
@@ -278,12 +278,15 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef)
        return 0;
 }
 
-PyObject*
-SCA_ILogicBrick::py_getattro(PyObject *attr)
+PyObject* SCA_ILogicBrick::py_getattro(PyObject *attr)
 {
   py_getattro_up(CValue);
 }
 
+PyObject* SCA_ILogicBrick::py_getattro_dict() {
+       py_getattro_dict_up(CValue);
+}
+
 int SCA_ILogicBrick::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(CValue);
index e59d05ea0516f111bbcccf5a1f1581176dbde646..f2353741d399270d360f5f7a463c7d551a987cb1 100644 (file)
@@ -80,6 +80,7 @@ public:
        virtual bool            LessComparedTo(SCA_ILogicBrick* other);
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        static class SCA_LogicManager*  m_sCurrentLogicManager;
index 75804525e7a05e15ccdc46907ac7620ffad84d74..8e599e6411ac534bb2ed9174707badc996407ffe 100644 (file)
@@ -418,3 +418,6 @@ PyObject* SCA_IObject::py_getattro(PyObject *attr) {
        py_getattro_up(CValue);
 }
 
+PyObject* SCA_IObject::py_getattro_dict() {
+       py_getattro_dict_up(CValue);
+}
index 44ed3c8f3fe7cc19a00d35e38673af83f0c57612..7f63c9f5efd0528c955b197ead7bd06cd73cf09d 100644 (file)
@@ -146,6 +146,7 @@ public:
        
        // here come the python forwarded methods
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
        virtual int GetGameObjectType() {return -1;}
        
index 68f5653d53ae9a08e7281b0bd6fabdd178c9c35d..dde970962b678bb4bde5a160819f8de70bfa7652 100644 (file)
@@ -459,12 +459,15 @@ PyAttributeDef SCA_ISensor::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject*
-SCA_ISensor::py_getattro(PyObject *attr)
+PyObject* SCA_ISensor::py_getattro(PyObject *attr)
 {
        py_getattro_up(SCA_ILogicBrick);
 }
 
+PyObject* SCA_ISensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ILogicBrick);
+}
+
 int SCA_ISensor::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_ILogicBrick);
index 6b1c8cca104bd19f97ee83d1cfc159694c9b44e9..e2ceec19b69a49b3190f90511437eddfac1c7aa6 100644 (file)
@@ -137,6 +137,7 @@ public:
        /* Python functions: */
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        //Deprecated functions ----->
index 1c601eded815c8158310f57cc1e70bf2bc9248fe..a8c6f87ebdd1e74c2a4c0338edca14c2e93e6e2f 100644 (file)
@@ -339,6 +339,10 @@ PyObject* SCA_JoystickSensor::py_getattro(PyObject *attr)
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_JoystickSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_JoystickSensor::py_setattro(PyObject *attr, PyObject *value) 
 {
        py_setattro_up(SCA_ISensor);
index cf3e7e74414f3dc4cf516271d22e7840674cc033..20fff66f66cb56b3808f2badeace35a8f7e4cb06 100644 (file)
@@ -123,6 +123,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* Joystick Index */
index c946156283f467e6ae7b8023793723baf0d30188..96969dc6dc7e7ad1c850318b51563864be07ba10 100644 (file)
@@ -664,12 +664,15 @@ PyAttributeDef SCA_KeyboardSensor::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject*
-SCA_KeyboardSensor::py_getattro(PyObject *attr)
+PyObject* SCA_KeyboardSensor::py_getattro(PyObject *attr)
 {
   py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_KeyboardSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_KeyboardSensor::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_ISensor);
index 073b3e6dbe05844bc070b65826518ee2dcba2ee1..1dd6ea21fcddf2a1f25bb60362a235e315094480 100644 (file)
@@ -111,6 +111,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        //Deprecated functions ----->
index 4dbeb156e6386fd318593706868cebbfca7ea5ad..0bae676d19d12179d9168d58ed510e5c9493038f 100644 (file)
@@ -342,6 +342,10 @@ PyObject* SCA_MouseSensor::py_getattro(PyObject *attr)
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_MouseSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_MouseSensor::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_ISensor);
index 2d1c496029deb12e832b31b20f7f0f888eed4b48..528237475db102cd0e84e58333723e58819ab844 100644 (file)
@@ -110,6 +110,7 @@ class SCA_MouseSensor : public SCA_ISensor
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        //Deprecated functions ----->
index 703c9c1bbaf18da56afb7a03c69a0f35427597fa..dedf32df3c9b670aa7edc5138b4cf850dbba662c 100644 (file)
@@ -145,4 +145,8 @@ PyObject* SCA_NANDController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_NANDController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index 11600914a1a212413b313ff52a958a92a6cd63f9..0ae0ff19745ab6e5ca4c1cbae3529a292d540e24 100644 (file)
@@ -49,6 +49,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
 };
 
index 06acae5a81a4cf36899ab3153433af8fdcc094f2..8cd575ffef3a3e02680f935ed7c063b7d816457e 100644 (file)
@@ -145,4 +145,8 @@ PyObject* SCA_NORController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_NORController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index fc814e28d37285dae3f581d5ade1f65e9f7045f9..06cbb70a489597cbfdab6b89c8797cb8ea4cc79e 100644 (file)
@@ -49,6 +49,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject*               py_getattro_dict();
 
 };
 
index 319ff04f776b156118450d83f9e05cbd79e711ed..a12246e9a7336aabae5bad3d3d58f376844b51a5 100644 (file)
@@ -138,4 +138,8 @@ PyObject* SCA_ORController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_ORController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index fdc81486e741143e2abb1d7fd4355907be55d392..66f772c739edf46e35633cade6773f5645b034db 100644 (file)
@@ -50,6 +50,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 };
 
 #endif //__KX_ORCONTROLLER
index c4db723ee8940fda5c0e413265cff1b3d602ed2c..beb7a09a1372b238ea1094740cda9e07b592338b 100644 (file)
@@ -279,6 +279,10 @@ PyObject* SCA_PropertyActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* SCA_PropertyActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int SCA_PropertyActuator::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_IActuator);
 }
index bb841cf88ad023b73143b1ce62bbe6d28560ebb4..a8df08dfc6ecaad776317eb3925c272d6c72451f 100644 (file)
@@ -87,6 +87,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject*  py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // python wrapped methods
index de8a9fcf03ed25619dcfea05d7ec114ca55c8aac..c56dd3a12f4247c219dfc9e63fae32f6fcb9f24c 100644 (file)
@@ -356,6 +356,10 @@ PyObject* SCA_PropertySensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_PropertySensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_PropertySensor::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_ISensor);
 }
index e1e378a973c70ea4707f0a1fa8cd3c518d7a7ae8..7abf4d44a5b2ed0740a492b1647fcb3e6d08b05d 100644 (file)
@@ -90,6 +90,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* 1. getType */
index 3a72d9b765293a161c5e23511d9bfd58b20218ca..b9df198f7daf0d99039f5d58fedc4e9306fd87eb 100644 (file)
@@ -395,6 +395,10 @@ PyObject* SCA_RandomActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* SCA_RandomActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int SCA_RandomActuator::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_IActuator);
index 8f58ed0dcece58a70998361fd136791bb35abeee..310e8a7fbf9adf8cf56efaf366cb33dd1f579025 100644 (file)
@@ -97,6 +97,7 @@ class SCA_RandomActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
index 5ead82db428ec798aa00da58b0b7bb12c8a01962..494b7a3694ea42dec4355cfe97a80bf17ba641fc 100644 (file)
@@ -170,6 +170,10 @@ PyObject* SCA_RandomSensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* SCA_RandomSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int SCA_RandomSensor::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_ISensor);
index 764692600c3c567662dea8476fd8881c4a8d534d..63a96dd72d0342e70785c8ff5be5ffbcf1c2be59 100644 (file)
@@ -61,6 +61,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* 1. setSeed                                                            */
index e9bb37ee958e37c3de58bd47d95bbc3db7cb05d1..145afa6aec527174db2f5f76af717ff8e29efd61 100644 (file)
@@ -149,4 +149,8 @@ PyObject* SCA_XNORController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_XNORController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index c992d5f183485d6d2628650f3383d0cc2ba63fe1..4aad5763cb02629780600a994fd19c98d3317fae 100644 (file)
@@ -49,6 +49,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
 };
 
index 791a139975f11d8a5ab2d4cb5093291a10168a72..4dfba3a56acafc73c9451f527471e5fad3ab65d6 100644 (file)
@@ -149,4 +149,8 @@ PyObject* SCA_XORController::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IController);
 }
 
+PyObject* SCA_XORController::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IController);
+}
+
 /* eof */
index 065b31fd90197ab74296d06d30fe1e73ac4042ac..feb9f2ed07c2a3e9f03f892dbdf8ab78c8df0fd2 100644 (file)
@@ -49,6 +49,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
 };
 
index 88d920043e03a2c45b6a704bdc6f6d7fecde73f4..2b3612ec3ae7e85d08acf0e17d173e2afd83ee57 100644 (file)
@@ -734,6 +734,10 @@ PyObject* BL_Shader::py_getattro(PyObject *attr)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* BL_Shader::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 
 PyMethodDef BL_Shader::Methods[] = 
 {
index 08cad5071fd61c20bba5cc057936c4c4c3a82544..7db40e778ae6b0a3c4cfab9b968dc032dc8bcc86 100644 (file)
@@ -203,6 +203,7 @@ public:
 
        // Python interface
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual PyObject* py_repr(void) { return PyString_FromFormat("BL_Shader\n\tvertex shader:%s\n\n\tfragment shader%s\n\n", vertProg, fragProg); }
 
        // -----------------------------------
index 2483a6bfb39c92f2f4efd34d4df15c0b06fda0f9..9c36a89950524d5c94de9aa23ce653020b3b85cd 100644 (file)
@@ -157,6 +157,10 @@ PyObject* KX_NetworkMessageActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_NetworkMessageActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_NetworkMessageActuator::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_IActuator);
 }
index 850f825b8f375f050e847399bcc69b587e064e6d..cf92fd46fe0cdd55fb3efaa8c53971ab0bcd3c74 100644 (file)
@@ -62,6 +62,7 @@ public:
        /* ------------------------------------------------------------ */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // Deprecated ----->
index 7782567943ee68eab62edfa6271ce1bff7d6d0a0..b1b9c0e1fc951370efa43117d132458565b42c97 100644 (file)
@@ -227,6 +227,10 @@ PyObject* KX_NetworkMessageSensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* KX_NetworkMessageSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int KX_NetworkMessageSensor::py_setattro(PyObject *attr, PyObject *value) {
        return SCA_ISensor::py_setattro(attr, value);
 }
index ac0e880d25c7c5fb6119f27690ded595c5b792bd..3abba7cfffd05195df77e15c9c1e84d3f1603cc5 100644 (file)
@@ -73,6 +73,7 @@ public:
        /* ------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // Deprecated ----->
index 849332008ce9e31eff714bb2527f2ce5ee7b5303..2edfe4b718c48e3e6cae1d3795c4347782c54038 100644 (file)
@@ -784,6 +784,10 @@ PyObject* KX_BlenderMaterial::py_getattro(PyObject *attr)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* KX_BlenderMaterial::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 int KX_BlenderMaterial::py_setattro(PyObject *attr, PyObject *pyvalue)
 {
        return PyObjectPlus::py_setattro(attr, pyvalue);
index 48d4730ab07ee958b8bbfb668d6b04940e837ddb..57cdde3c94756cc39c21f7a6238bcd2fbfdd9bab 100644 (file)
@@ -83,6 +83,7 @@ public:
        
        // --------------------------------
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int       py_setattro(PyObject *attr, PyObject *pyvalue);
        virtual PyObject* py_repr(void) { return PyString_FromString(mMaterial->matname.ReadPtr()); }
 
index 121d45122651ef5e8f167d1a19abc29f18eca8f9..6e318cdcfa3c501fca57c855b6c7fa26aa05d584 100644 (file)
@@ -220,6 +220,10 @@ PyObject* KX_CDActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_CDActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_CDActuator::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_IActuator);
index b674755e59f1c3f705c9376a09d26f7ab16e225d..2fd05ab72e5d82a7fb9df4f82989af0ee4b21fad 100644 (file)
@@ -82,6 +82,7 @@ public:
        /* -------------------------------------------------------------------- */
 
        virtual PyObject*  py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // Deprecated ----->
index c8575424751983c75a4bbe942135b89b516f1ff6..f84ce23b7dd016984470efad7e127c848243109c 100644 (file)
@@ -544,6 +544,10 @@ PyObject* KX_Camera::py_getattro(PyObject *attr)
        py_getattro_up(KX_GameObject);
 }
 
+PyObject* KX_Camera::py_getattro_dict() {
+       py_getattro_dict_up(KX_GameObject);
+}
+
 int KX_Camera::py_setattro(PyObject *attr, PyObject *value)
 {      
        py_setattro_up(KX_GameObject);
index 4accd4bc2f1035a4367d2023b5ded5c23cdf70aa..6f818cb2c57d66f32d57097051e08e0015c0747f 100644 (file)
@@ -278,6 +278,7 @@ public:
        KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop);    
 
        virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */
+       virtual PyObject* py_getattro_dict();
        virtual int       py_setattro(PyObject *attr, PyObject *pyvalue);
        
        static PyObject*        pyattr_get_perspective(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index 355cdbb62633a0934ab71465ce223a358a917e8c..2ef7abfd1720afedccc28858038f8d4f3122c5e8 100644 (file)
@@ -425,6 +425,10 @@ PyObject* KX_CameraActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_CameraActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_CameraActuator::py_setattro(PyObject *attr, PyObject* value) {
        py_setattro_up(SCA_IActuator);
 }
index 9298e1e868d692f36d6d1ed3625a61e588e1f326..efa4e2f38d79d07eec2bb5712aa8b59451fa711c 100644 (file)
@@ -121,6 +121,7 @@ private :
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        /* set object to look at */
index 1ce7fac0cfe8dc094978e067871978ce0ba8f450..00fed43cbe84828a781069eeb13f88a671dc242e 100644 (file)
@@ -640,6 +640,10 @@ PyObject* KX_ConstraintActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_ConstraintActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_ConstraintActuator::py_setattro(PyObject *attr, PyObject* value)
 {
        py_setattro_up(SCA_IActuator);
index 98f6fcd790667111c868e7eefd24f3847c7a150f..84512c0ecf28ec815a7e8bd19fac210999692839 100644 (file)
@@ -144,6 +144,7 @@ protected:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
index 7c3abb49159e3ed262519fc16819344cc8276561..c537c9abe010e6c0e930dbfa5c04522995c4ada4 100644 (file)
@@ -87,12 +87,16 @@ PyParentObject KX_ConstraintWrapper::Parents[] = {
        NULL
 };
 
-PyObject*      KX_ConstraintWrapper::py_getattro(PyObject *attr)
+//here you can search for existing data members (like mass,friction etc.)
+PyObject* KX_ConstraintWrapper::py_getattro(PyObject *attr)
 {
-       //here you can search for existing data members (like mass,friction etc.)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* KX_ConstraintWrapper::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 int    KX_ConstraintWrapper::py_setattro(PyObject *attr,PyObject* pyobj)
 {
        int result = 1;
index 6e67d842cb6d175b194203c54e0cbfa49e6d5bf3..3270d57188d719f55be5f7d2d1ba5e74d3b177f2 100644 (file)
@@ -36,6 +36,7 @@ class KX_ConstraintWrapper : public PyObjectPlus
 {
        Py_Header;
        virtual PyObject*               py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int                     py_setattro(PyObject *attr, PyObject *value);
 public:
        KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type);
index 8b587c6f7de95687146f828f2d5e4a06e1c2bda4..0a411396ff81bd44264e7582fc803bc14f05cf72 100644 (file)
@@ -253,12 +253,15 @@ PyAttributeDef KX_GameActuator::Attributes[] = {
        { NULL }        //Sentinel
 };
 
-PyObject*
-KX_GameActuator::py_getattro(PyObject *attr)
+PyObject* KX_GameActuator::py_getattro(PyObject *attr)
 {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_GameActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_GameActuator::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_IActuator);
index 570cb2e68efe0f871d10b75bf2e8630f1e9929b9..b2b1d6ec2b954c7f5a20c05187eb3ae69b8be4b1 100644 (file)
@@ -78,6 +78,7 @@ protected:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // Deprecated functions ----->
index bea0fcff2af2dbbc080a5466203a1eef5ac4717f..1f4c9c2e9d5009c49f1e84738f35d578455f17eb 100644 (file)
@@ -1153,8 +1153,6 @@ PyAttributeDef KX_GameObject::Attributes[] = {
        KX_PYATTRIBUTE_RW_FUNCTION("localScaling",      KX_GameObject, pyattr_get_localScaling, pyattr_set_localScaling),
        KX_PYATTRIBUTE_RO_FUNCTION("worldScaling",      KX_GameObject, pyattr_get_worldScaling),
        
-       KX_PYATTRIBUTE_RO_FUNCTION("__dict__",  KX_GameObject, pyattr_get_dir_dict),
-       
        /* Experemental, dont rely on these yet */
        KX_PYATTRIBUTE_RO_FUNCTION("sensors",           KX_GameObject, pyattr_get_sensors),
        KX_PYATTRIBUTE_RO_FUNCTION("controllers",       KX_GameObject, pyattr_get_controllers),
@@ -1703,37 +1701,6 @@ PyObject* KX_GameObject::pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE
        return resultlist;
 }
 
-/* __dict__ only for the purpose of giving useful dir() results */
-PyObject* KX_GameObject::pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
-       KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
-       PyObject *dict_str = PyString_FromString("__dict__");
-       PyObject *dict= py_getattr_dict(self->SCA_IObject::py_getattro(dict_str), Type.tp_dict);
-       Py_DECREF(dict_str);
-       
-       if(dict==NULL)
-               return NULL;
-       
-       /* Not super fast getting as a list then making into dict keys but its only for dir() */
-       PyObject *list= self->ConvertKeysToPython();
-       if(list)
-       {
-               int i;
-               for(i=0; i<PyList_Size(list); i++)
-                       PyDict_SetItem(dict, PyList_GET_ITEM(list, i), Py_None);
-       }
-       else
-               PyErr_Clear();
-       
-       Py_DECREF(list);
-       
-       /* Add m_attr_dict if we have it */
-       if(self->m_attr_dict)
-               PyDict_Update(dict, self->m_attr_dict);
-       
-       return dict;
-}
-
 /* We need these because the macros have a return in them */
 PyObject* KX_GameObject::py_getattro__internal(PyObject *attr)
 {
@@ -1772,6 +1739,35 @@ PyObject* KX_GameObject::py_getattro(PyObject *attr)
        return object;
 }
 
+PyObject* KX_GameObject::py_getattro_dict() {
+       //py_getattro_dict_up(SCA_IObject);
+       PyObject *dict= py_getattr_dict(SCA_IObject::py_getattro_dict(), Type.tp_dict);
+       if(dict==NULL)
+               return NULL;
+       
+       /* normally just return this but KX_GameObject has some more items */
+
+       
+       /* Not super fast getting as a list then making into dict keys but its only for dir() */
+       PyObject *list= ConvertKeysToPython();
+       if(list)
+       {
+               int i;
+               for(i=0; i<PyList_Size(list); i++)
+                       PyDict_SetItem(dict, PyList_GET_ITEM(list, i), Py_None);
+       }
+       else
+               PyErr_Clear();
+       
+       Py_DECREF(list);
+       
+       /* Add m_attr_dict if we have it */
+       if(m_attr_dict)
+               PyDict_Update(dict, m_attr_dict);
+       
+       return dict;
+}
+
 int KX_GameObject::py_setattro(PyObject *attr, PyObject *value)        // py_setattro method
 {
        int ret;
index ec02dc17b752a36117474eeea09fe812ee38f008..e81429dff5afad161425b2062587c52e00c5006e 100644 (file)
@@ -816,6 +816,7 @@ public:
         */
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);               // py_setattro method
        virtual int                             py_delattro(PyObject *attr);
        virtual PyObject* py_repr(void)
@@ -904,9 +905,6 @@ public:
        static int                      pyattr_set_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
        static PyObject*        pyattr_get_meshes(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        
-       /* for dir(), python3 uses __dir__() */
-       static PyObject*        pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-       
        /* Experemental! */
        static PyObject*        pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_controllers(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
index f04e3c79a8e59f4900d0ccaf2509a45a08e02b01..df80085d9f2688fc6ae349e2f3afa8b2b2653888 100644 (file)
@@ -477,6 +477,10 @@ PyObject* KX_IpoActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_IpoActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_IpoActuator::py_setattro(PyObject *attr, PyObject *value)       // py_setattro method
 {
        py_setattro_up(SCA_IActuator);
index 184ad5512dec7d39320815ed75c80b6ee8e320ca..fb3b0eb1dd24ebfa40c39b59231a0bc2be945aac 100644 (file)
@@ -142,6 +142,7 @@ public:
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
        
        //KX_PYMETHOD_DOC
index 713838c88ece2257fcd4ed0bc4b90cf57fda6d1b..a1eb08e17bdae1a332488a707e15262e93fad16b 100644 (file)
@@ -216,6 +216,10 @@ PyObject* KX_LightObject::py_getattro(PyObject *attr)
        py_getattro_up(KX_GameObject);
 }
 
+PyObject* KX_LightObject::py_getattro_dict() {
+       py_getattro_dict_up(KX_GameObject);
+}
+
 
 int KX_LightObject::py_setattro(PyObject *attr, PyObject *pyvalue)
 {
index 4559954c8d7152caaba7dbfceff7e070fbf6ac6b..e5d48b6f975f9a0d28e845bebc50c8f50645737f 100644 (file)
@@ -63,6 +63,7 @@ public:
        void Update();
        
        virtual PyObject* py_getattro(PyObject *attr); /* lens, near, far, projection_matrix */
+       virtual PyObject* py_getattro_dict();
        virtual int       py_setattro(PyObject *attr, PyObject *pyvalue);
 
        virtual bool IsLight(void) { return true; }
index 6be1da55ff8a32b626fe7bc5e3b7e2a80afdd943..cefa2ba448882d4082ac4e770acb0cf60ab4091f 100644 (file)
@@ -108,6 +108,10 @@ PyObject* KX_MeshProxy::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IObject);
 }
 
+PyObject* KX_MeshProxy::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IObject);
+}
+
 int KX_MeshProxy::py_setattro(PyObject *attr, PyObject* value)
 {
        py_setattro_up(SCA_IObject);
index aeecefc09e6c972c539d4d63e97423041fee9b52..ce9e8fc39c5ceb7aa8f14be58c0ebf5cb647d6be 100644 (file)
@@ -58,6 +58,7 @@ public:
 
 // stuff for python integration
        virtual PyObject*  py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        KX_PYMETHOD(KX_MeshProxy,GetNumMaterials);      // Deprecated
index 87b5c81392d1f9e048dfffe8c9a4effde579ca94..d141aa482c8c8209c87fc4784b898ef2724b80a4 100644 (file)
@@ -387,6 +387,10 @@ PyObject* KX_MouseFocusSensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_MouseSensor);
 }
 
+PyObject* KX_MouseFocusSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_MouseSensor);
+}
+
 
 const char KX_MouseFocusSensor::GetHitObject_doc[] = 
 "getHitObject()\n"
index 8de1f88c5c315d4190fa9a9ec998bd6c2a674892..5a9618f52b2360a06ccd5d0ca460ed662eb03649 100644 (file)
@@ -89,7 +89,8 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
        /* --------------------------------------------------------------------- */
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
-       virtual PyObject*  py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
        KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget);
        KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource);
index 0489b7090e9dfa4aee642b0c702b85c3bbdcfd5c..ce519e1752c73ad8e12d3319b1c8e8e2a1396dd8 100644 (file)
@@ -334,6 +334,10 @@ PyObject* KX_NearSensor::py_getattro(PyObject *attr)
        py_getattro_up(KX_TouchSensor);
 }
 
+PyObject* KX_NearSensor::py_getattro_dict() {
+       py_getattro_dict_up(KX_TouchSensor);
+}
+
 int KX_NearSensor::py_setattro(PyObject*attr, PyObject* value)
 {
        py_setattro_up(KX_TouchSensor);
index 26c5feb4e67afe7db052eb98ce4680e777f4eb5b..144f75f477221321a86edb551e91e845c4f3f978 100644 (file)
@@ -83,6 +83,7 @@ public:
        /* Python interface ---------------------------------------------------- */
        /* --------------------------------------------------------------------- */
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        //No methods
index 861c575797152f1f4515c1630eee890e000d8e59..c115a8f33bce9ab2a7e082550bb32f3541b43d25 100644 (file)
@@ -340,6 +340,10 @@ PyObject* KX_ObjectActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 };
 
+PyObject* KX_ObjectActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 /* 1. set ------------------------------------------------------------------ */
 /* Removed! */
 
index a812942a0aeb3a2e9c22ec5cda967c3950bd9931..ab5fbe44409268ec58036393263f7af39a340b39 100644 (file)
@@ -154,6 +154,7 @@ public:
        /* --------------------------------------------------------------------- */
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
        KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce);
        KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce);
index 0093cf5f313347fd11e703071b7267b83fbd190d..79e826704866855fd864da279e84ff3d92d27b5e 100644 (file)
@@ -211,6 +211,10 @@ PyObject* KX_ParentActuator::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_ParentActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_ParentActuator::py_setattro(PyObject *attr, PyObject* value) {
        py_setattro_up(SCA_IActuator);
 }
index f9f0b73b876d76ddab744bfd41dc68932138b339..a9bf7304bc81a3e5ef70922c4b667ee28a690fc5 100644 (file)
@@ -77,6 +77,7 @@ class KX_ParentActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        /* These are used to get and set m_ob */
index fda639c09e01f12e7846f510eeaf3f9fce46c260..c0c15b5599c0586f46a03643537814cc6f3b99eb 100644 (file)
@@ -136,11 +136,14 @@ PyParentObject KX_PhysicsObjectWrapper::Parents[] = {
        NULL
 };
 
-PyObject*      KX_PhysicsObjectWrapper::py_getattro(PyObject *attr)
+PyObject* KX_PhysicsObjectWrapper::py_getattro(PyObject *attr)
 {
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* KX_PhysicsObjectWrapper::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
 
 int    KX_PhysicsObjectWrapper::py_setattro(PyObject *attr,PyObject *pyobj)
 {
index 7e10dc3ccf4cac770193335b25476974774fe699..1b59686babc0a8e55a881d1a4153be242d7f8c41 100644 (file)
@@ -37,6 +37,7 @@ class KX_PhysicsObjectWrapper : public PyObjectPlus
        Py_Header;
 
        virtual PyObject*               py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int                     py_setattro(PyObject *attr, PyObject *value);
 public:
        KX_PhysicsObjectWrapper(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type);
index 2e5dd72db0eea9bf4197c823708c78c731a9118b..fefea232e991d512b7ea20b5cc4bef83619de4a9 100644 (file)
@@ -159,6 +159,10 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IObject);
 }
 
+PyObject* KX_PolyProxy::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IObject);
+}
+
 KX_PolyProxy::KX_PolyProxy(const RAS_MeshObject*mesh, RAS_Polygon* polygon)
 :      m_polygon(polygon),
        m_mesh((RAS_MeshObject*)mesh)
index 275e65da81040bfc3b8c3021963af308e588af2e..88a06850ee07c005a6daf488dbf8d459ef7f859c 100644 (file)
@@ -54,6 +54,7 @@ public:
 
 // stuff for python integration
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
 
        KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getMaterialIndex)
        KX_PYMETHOD_DOC_NOARGS(KX_PolyProxy,getNumVertex)
index 46d04486cc60236cf7a71d2e2c9ca98f979ea6f5..2d5a5f99cea6b7803e6bd8db22cc3ba1ef46d1d6 100644 (file)
@@ -237,6 +237,10 @@ PyObject* KX_PolygonMaterial::py_getattro(PyObject *attr)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* KX_PolygonMaterial::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 int KX_PolygonMaterial::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(PyObjectPlus);
index 9865a66e83620f1e9e4ec39f05c6366a6ceb7b87..e5816058bbf94aa9979a1ae26472ded3e8716f79 100644 (file)
@@ -117,6 +117,7 @@ public:
        KX_PYMETHOD_DOC(KX_PolygonMaterial, loadProgram);
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int       py_setattro(PyObject *attr, PyObject *pyvalue);
        virtual PyObject* py_repr(void) { return PyString_FromString(m_material ? ((ID *)m_material)->name+2 : ""); }
        
index 8277e7ef19c4baccb56c50ce9744517d329abce8..d1075f9b29636a4625ae5896e2331a38757611e1 100644 (file)
@@ -304,6 +304,10 @@ PyObject* KX_RadarSensor::py_getattro(PyObject *attr)
        py_getattro_up(KX_NearSensor);
 }
 
+PyObject* KX_RadarSensor::py_getattro_dict() {
+       py_getattro_dict_up(KX_NearSensor);
+}
+
 int KX_RadarSensor::py_setattro(PyObject *attr, PyObject* value)
 {
        py_setattro_up(KX_NearSensor);
index c3a941696ce940a93cd639b76ab107a6820a889b..8389a2a29eb4f07080cca7ff448744887f53ba8a 100644 (file)
@@ -90,6 +90,7 @@ public:
        };
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        //Deprecated ----->
index 06c04dbf10dbcfbe5f30934ff0dc12b48848b904..360aa1a85a80de26ab03d9b3fc65214aed2ce0ee 100644 (file)
@@ -449,6 +449,10 @@ PyObject* KX_RaySensor::py_getattro(PyObject *attr) {
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* KX_RaySensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int KX_RaySensor::py_setattro(PyObject *attr, PyObject *value) {
        py_setattro_up(SCA_ISensor);
 }
index a5d7d15c60caa962e2d6b6b17120dafe79f9c456..558840e2f17463ca3336977408fc403a2284da77 100644 (file)
@@ -87,6 +87,7 @@ public:
 
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
        
        // Deprecated ----->
index 56d94a8d226a1bc7cec2bf0af6b6928f820b5aa0..b5aa7a2f4c25f5d9efe4d95765f15126aa5ed8e0 100644 (file)
@@ -260,6 +260,10 @@ PyObject* KX_SCA_AddObjectActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SCA_AddObjectActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_SCA_AddObjectActuator::py_setattro(PyObject *attr, PyObject* value) 
 {
        py_setattro_up(SCA_IActuator);
index 4ece5a6d83b16171990a8b071ac6f9475f834b2c..6746b7d1bc6e3d8716f5939d1799e9b4e243e749 100644 (file)
@@ -111,6 +111,7 @@ public:
        Update();
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
                SCA_IObject*    
index 9c9cdcd6c4c3d832b038ff050393ef80e1adc34c..dd3250f5b61d64df8aff24aa12d344349573d89a 100644 (file)
@@ -97,6 +97,10 @@ PyObject* KX_SCA_DynamicActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SCA_DynamicActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_SCA_DynamicActuator::py_setattro(PyObject *attr, PyObject* value)
 {
        py_setattro_up(SCA_IActuator);
index 99855124bdb27536c15f4b71568b31eb1902baa0..4add707f8cddeafcddc37397335896b8e091b3d9 100644 (file)
@@ -75,6 +75,7 @@ class KX_SCA_DynamicActuator : public SCA_IActuator
 
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* 1. setOperation */
index 3b42577810e217c1560648f221394c727aacbe9a..c0dc6ea6b5537cea17d5cda5eaeef172eb9c392d 100644 (file)
@@ -136,4 +136,8 @@ PyObject* KX_SCA_EndObjectActuator::py_getattro(PyObject *attr)
   py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SCA_EndObjectActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 /* eof */
index 2940246f443bfa6a2288031eddc71d2bc2280cca..70d72f1f8da3c5065417b5e000fe330bb5fb98b0 100644 (file)
@@ -65,6 +65,7 @@ class KX_SCA_EndObjectActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        
 }; /* end of class KX_EditObjectActuator : public SCA_PropertyActuator */
 
index 38f8d581d556df177c3f15f78c0375607752ae14..b7135a5503a5a72a04435d88cddd5ed32ae239fc 100644 (file)
@@ -99,6 +99,10 @@ PyObject* KX_SCA_ReplaceMeshActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SCA_ReplaceMeshActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_SCA_ReplaceMeshActuator::py_setattro(PyObject *attr, PyObject* value) 
 {
        py_setattro_up(SCA_IActuator);
index 7a18df2356d198cb84e9b457fa192696c589f8d4..0e7f7852701c0213dd756c78ef48023400dde0b0 100644 (file)
@@ -72,6 +72,7 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
        void    InstantReplaceMesh();
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
index aa7bd65f240ef671578a92a862bcb75785c1fbec..f91c4674113edf4c1929b539386d3b162410b0b3 100644 (file)
@@ -1630,19 +1630,6 @@ PyObject* KX_Scene::pyattr_get_active_camera(void *self_v, const KX_PYATTRIBUTE_
        return self->GetActiveCamera()->GetProxy();
 }
 
-/* __dict__ only for the purpose of giving useful dir() results */
-PyObject* KX_Scene::pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
-{
-       KX_Scene* self= static_cast<KX_Scene*>(self_v);
-       /* Useually done by py_getattro_up but in this case we want to include m_attr_dict dict */
-       PyObject *dict_str= PyString_FromString("__dict__");
-       PyObject *dict= py_getattr_dict(self->PyObjectPlus::py_getattro(dict_str), Type.tp_dict);
-       Py_DECREF(dict_str);
-       
-       PyDict_Update(dict, self->m_attr_dict);
-       return dict;
-}
-
 PyAttributeDef KX_Scene::Attributes[] = {
        KX_PYATTRIBUTE_RO_FUNCTION("name",                      KX_Scene, pyattr_get_name),
        KX_PYATTRIBUTE_RO_FUNCTION("objects",           KX_Scene, pyattr_get_objects),
@@ -1651,7 +1638,6 @@ PyAttributeDef KX_Scene::Attributes[] = {
        KX_PYATTRIBUTE_BOOL_RO("activity_culling",      KX_Scene, m_activity_culling),
        KX_PYATTRIBUTE_FLOAT_RW("activity_culling_radius", 0.5f, FLT_MAX, KX_Scene, m_activity_box_radius),
        KX_PYATTRIBUTE_BOOL_RO("dbvt_culling",          KX_Scene, m_dbvt_culling),
-       KX_PYATTRIBUTE_RO_FUNCTION("__dict__",          KX_Scene, pyattr_get_dir_dict),
        { NULL }        //Sentinel
 };
 
@@ -1685,6 +1671,18 @@ PyObject* KX_Scene::py_getattro(PyObject *attr)
        return object;
 }
 
+PyObject* KX_Scene::py_getattro_dict() {
+       //py_getattro_dict_up(PyObjectPlus);
+       
+       PyObject *dict= py_getattr_dict(PyObjectPlus::py_getattro_dict(), Type.tp_dict);
+       if(dict==NULL)
+               return NULL;
+       
+       /* normally just return this but KX_Scene has some more items */
+       
+       PyDict_Update(dict, m_attr_dict);
+       return dict;
+}
 
 int KX_Scene::py_setattro(PyObject *attr, PyObject *value)
 {
index a06c66ec5dd0dfd9a8ca645958a3cd6adf4117ee..83a4692f81518b8febdd512cb6d28b4140219b6d 100644 (file)
@@ -593,12 +593,10 @@ public:
        static PyObject*        pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_objects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
        static PyObject*        pyattr_get_active_camera(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-       
-       /* for dir(), python3 uses __dir__() */
-       static PyObject*        pyattr_get_dir_dict(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
-       
 
        virtual PyObject* py_getattro(PyObject *attr); /* name, active_camera, gravity, suspended, viewport, framing, activity_culling, activity_culling_radius */
+       virtual PyObject* py_getattro_dict();
+       
        virtual int py_setattro(PyObject *attr, PyObject *pyvalue);
        virtual int py_delattro(PyObject *attr);
        virtual PyObject* py_repr(void) { return PyString_FromString(GetName().ReadPtr()); }
index f54d85422609c4e62a55c865771b95dacddd6149..c525aeb1e3f15442544393fae958c7cea6c91138 100644 (file)
@@ -281,6 +281,10 @@ PyObject* KX_SceneActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SceneActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_SceneActuator::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_IActuator);
index 803c5106a606f3b225442def12f20828e05835cd..315e97e8f700f265cfe63b07df7891c96010ad26 100644 (file)
@@ -93,6 +93,7 @@ class KX_SceneActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        /* 1. set                                                                */
index 412be497c5aae2ee3889a5994838004098aa8177..4103da4ad93e61b90dfb55af69470cc5329fa037 100644 (file)
@@ -340,6 +340,10 @@ PyObject* KX_SoundActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_SoundActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_SoundActuator::py_setattro(PyObject *attr, PyObject* value) {
        py_setattro_up(SCA_IActuator);
 }
index d5e678bbecdbbd59cdbad6f5580439ad5d703e7a..ad58087dc57bf4ad34b1d11ec54d5e84c538d162 100644 (file)
@@ -81,6 +81,7 @@ public:
        /* -------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        KX_PYMETHOD_DOC_NOARGS(KX_SoundActuator, startSound);
index 976e7ea52047040e087e18cb91a1f51f789c5c9f..16512dc66991b3442ab7d83cda7a0dc7cbb0aed1 100644 (file)
@@ -156,7 +156,11 @@ PyAttributeDef KX_StateActuator::Attributes[] = {
 PyObject* KX_StateActuator::py_getattro(PyObject *attr)
 {
        py_getattro_up(SCA_IActuator);
-};
+}
+
+PyObject* KX_StateActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
 
 int KX_StateActuator::py_setattro(PyObject *attr, PyObject* value)
 {
index 4a64894259dc8a29b8a81cb9c41f532db1061f54..7e7056bd6af42e38193394bd08e494fe1b715da6 100644 (file)
@@ -76,6 +76,7 @@ class KX_StateActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
        //KX_PYMETHOD_DOC
        KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation);
index 5a6e8e6f5016318f7a9f56d48163cdaa4c2ac6eb..8995a0c198ac33aa76da11e60efd4d6350a7cec6 100644 (file)
@@ -296,6 +296,10 @@ PyObject* KX_TouchSensor::py_getattro(PyObject *attr)
        py_getattro_up(SCA_ISensor);
 }
 
+PyObject* KX_TouchSensor::py_getattro_dict() {
+       py_getattro_dict_up(SCA_ISensor);
+}
+
 int KX_TouchSensor::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_ISensor);
index 15ef653c1b25e6cceab986104bf0f90604fec316..4bcc313b65bf7205b58de1f0b34cd122f4728e91 100644 (file)
@@ -121,6 +121,7 @@ public:
        /* --------------------------------------------------------------------- */
        
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        //Deprecated ----->
index fbf43de6cf44b16c33cba41cbb52e792825f1f2d..808bf0a55b56a330a16b4367921fec30211e1946 100644 (file)
@@ -509,6 +509,10 @@ PyObject* KX_TrackToActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_TrackToActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_TrackToActuator::py_setattro(PyObject *attr, PyObject* value)
 {
        py_setattro_up(SCA_IActuator);
index 99505f93cfe0c23c68085f5cb93aa224d90acedc..a17147c0842f10b03a9d78f6a56653b675e1b6b0 100644 (file)
@@ -73,6 +73,7 @@ class KX_TrackToActuator : public SCA_IActuator
 
        /* Python part */
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject* value);
 
        /* These are used to get and set m_ob */
index 1a6fb196db5728017928b8fee41bddc78544a744..5a0ec3515f6b7332b40fa38319b1fc94814d7987 100644 (file)
@@ -303,6 +303,10 @@ PyObject*  KX_VehicleWrapper::py_getattro(PyObject *attr)
        py_getattro_up(PyObjectPlus);
 }
 
+PyObject* KX_VehicleWrapper::py_getattro_dict() {
+       py_getattro_dict_up(PyObjectPlus);
+}
+
 int    KX_VehicleWrapper::py_setattro(PyObject *attr,PyObject* pyobj)
 {
        /* TODO - strange setattr, needs updating */
index de7fe75cfba0a69a0e553de323af69c7097708f3..c2b5e3d92517eb5bb7cb39f62815597d23c4ff98 100644 (file)
@@ -13,6 +13,7 @@ class KX_VehicleWrapper : public PyObjectPlus
 {
        Py_Header;
        virtual PyObject*               py_getattro(PyObject *attr);
+       virtual PyObject*               py_getattro_dict();
        virtual int                     py_setattro(PyObject *attr, PyObject *value);
 
        std::vector<PHY_IMotionState*> m_motionStates;
index 88f63334285d5f21901cd79d31571e39ae0e7c99..e5078bfa18b1239a03a79bde10ade3f5a954027e 100644 (file)
@@ -159,6 +159,10 @@ KX_VertexProxy::py_getattro(PyObject *attr)
   py_getattro_up(SCA_IObject);
 }
 
+PyObject* KX_VertexProxy::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IObject);
+}
+
 int    KX_VertexProxy::py_setattro(PyObject *attr, PyObject *pyvalue)
 {
   char *attr_str= PyString_AsString(attr);
index 67a15d96768720e93a691fc601c3ba5ea6073087..50fe6b27704eb38da9a88050b91012d4b222d320 100644 (file)
@@ -55,6 +55,7 @@ public:
 
 // stuff for python integration
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int    py_setattro(PyObject *attr, PyObject *pyvalue);
 
        KX_PYMETHOD_NOARGS(KX_VertexProxy,GetXYZ);
index ba59d0d3d47f1153895d9cb1b0d4354a432526d9..9b1849511fee165187fee70c70e87cad6d1fac8d 100644 (file)
@@ -143,6 +143,10 @@ PyObject* KX_VisibilityActuator::py_getattro(PyObject *attr)
        py_getattro_up(SCA_IActuator);
 }
 
+PyObject* KX_VisibilityActuator::py_getattro_dict() {
+       py_getattro_dict_up(SCA_IActuator);
+}
+
 int KX_VisibilityActuator::py_setattro(PyObject *attr, PyObject *value)
 {
        py_setattro_up(SCA_IActuator);
index 04633bce66503076c2cd0f8b725ad4fe29407cfb..45aba50f64535cd4c00ad39373a5d2deb959ec60 100644 (file)
@@ -70,6 +70,7 @@ class KX_VisibilityActuator : public SCA_IActuator
        /* --------------------------------------------------------------------- */
 
        virtual PyObject* py_getattro(PyObject *attr);
+       virtual PyObject* py_getattro_dict();
        virtual int py_setattro(PyObject *attr, PyObject *value);
 
        // Deprecated ----->