diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 07:11:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-31 07:11:39 +0300 |
commit | 0876fce0094ad3e37be4b197ef8850757eacd37b (patch) | |
tree | bdcd409899a59f1d0239b14d0ec79a7e5f531a06 /source/gameengine/Converter | |
parent | 50dab4fc37d33352c2f1c6181da9d54799e36a12 (diff) |
rename and negate DISABLE_PYTHON --> WITH_PYTHON
Diffstat (limited to 'source/gameengine/Converter')
18 files changed, 39 insertions, 41 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index b8d4c4e0f04..39e3e87708e 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -428,7 +428,7 @@ bool BL_ActionActuator::Update(double curtime, bool frame) return keepgoing; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -674,4 +674,4 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA return ret; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 10ce1fad27a..9682c0e45f7 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -84,7 +84,7 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON KX_PYMETHOD_O(BL_ActionActuator,GetChannel); KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); @@ -131,7 +131,7 @@ public: return 1; } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: diff --git a/source/gameengine/Converter/BL_ArmatureActuator.cpp b/source/gameengine/Converter/BL_ArmatureActuator.cpp index 82b8307a2bc..db36f7e7c38 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.cpp +++ b/source/gameengine/Converter/BL_ArmatureActuator.cpp @@ -175,7 +175,7 @@ bool BL_ArmatureActuator::Update(double curtime, bool frame) return result; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ @@ -257,5 +257,5 @@ PyObject* BL_ArmatureActuator::pyattr_get_constraint(void *self, const struct KX return constraint->GetProxy(); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureActuator.h b/source/gameengine/Converter/BL_ArmatureActuator.h index 72e2e96ea73..b3f9ee2f1f2 100644 --- a/source/gameengine/Converter/BL_ArmatureActuator.h +++ b/source/gameengine/Converter/BL_ArmatureActuator.h @@ -66,14 +66,14 @@ public: virtual bool Update(double curtime, bool frame); virtual void ReParent(SCA_IObject* parent); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* These are used to get and set m_target */ static PyObject* pyattr_get_constraint(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON private: // identify the constraint that this actuator controls diff --git a/source/gameengine/Converter/BL_ArmatureChannel.cpp b/source/gameengine/Converter/BL_ArmatureChannel.cpp index 8f5ec230486..13de701c510 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.cpp +++ b/source/gameengine/Converter/BL_ArmatureChannel.cpp @@ -33,7 +33,7 @@ #include "BLI_math.h" #include "BLI_string.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject BL_ArmatureChannel::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -72,7 +72,7 @@ PyObject *BL_ArmatureChannel::NewProxy(bool py_owns) return NewProxyPlus_Ext(this, &Type, m_posechannel, py_owns); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON BL_ArmatureChannel::BL_ArmatureChannel( BL_ArmatureObject *armature, @@ -85,7 +85,7 @@ BL_ArmatureChannel::~BL_ArmatureChannel() { } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -461,4 +461,4 @@ PyObject *BL_ArmatureBone::py_bone_get_children(void *self, const struct KX_PYAT return childrenlist; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureChannel.h b/source/gameengine/Converter/BL_ArmatureChannel.h index 79f0cc80348..e1c18215c53 100644 --- a/source/gameengine/Converter/BL_ArmatureChannel.h +++ b/source/gameengine/Converter/BL_ArmatureChannel.h @@ -57,7 +57,7 @@ public: struct bPoseChannel *posechannel); virtual ~BL_ArmatureChannel(); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Python access virtual PyObject* py_repr(void); @@ -65,7 +65,7 @@ public: static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); static PyObject* py_attr_get_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int py_attr_set_joint_rotation(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; /* this is a factory class to access bBone data field in the GE. @@ -82,7 +82,7 @@ private: public: -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject *py_bone_repr(PyObject *self); static PyObject *py_bone_get_parent(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject *py_bone_get_children(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.cpp b/source/gameengine/Converter/BL_ArmatureConstraint.cpp index 0b7ab043d16..fa7f8a1bea1 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.cpp +++ b/source/gameengine/Converter/BL_ArmatureConstraint.cpp @@ -33,7 +33,7 @@ #include "BLI_math.h" #include "BLI_string.h" -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyTypeObject BL_ArmatureConstraint::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -62,7 +62,7 @@ PyObject* BL_ArmatureConstraint::py_repr(void) return PyUnicode_FromString(m_name); } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON BL_ArmatureConstraint::BL_ArmatureConstraint( BL_ArmatureObject *armature, @@ -237,7 +237,7 @@ void BL_ArmatureConstraint::SetSubtarget(KX_GameObject* subtarget) } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -447,4 +447,4 @@ int BL_ArmatureConstraint::py_attr_setattr(void *self_v, const struct KX_PYATTRI return PY_SET_ATTR_FAIL; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureConstraint.h b/source/gameengine/Converter/BL_ArmatureConstraint.h index a9f612b6c0c..92da8327edb 100644 --- a/source/gameengine/Converter/BL_ArmatureConstraint.h +++ b/source/gameengine/Converter/BL_ArmatureConstraint.h @@ -104,14 +104,14 @@ public: void SetTarget(KX_GameObject* target); void SetSubtarget(KX_GameObject* subtarget); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // Python access virtual PyObject* py_repr(void); static PyObject* py_attr_getattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int py_attr_setattr(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON }; #endif //__BL_ARMATURECONSTRAINT diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index 97d6b6efd27..0c5bb036b04 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -594,7 +594,7 @@ float BL_ArmatureObject::GetBoneLength(Bone* bone) const return (float)(MT_Point3(bone->head) - MT_Point3(bone->tail)).length(); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON @@ -661,4 +661,4 @@ KX_PYMETHODDEF_DOC_NOARGS(BL_ArmatureObject, update, Py_RETURN_NONE; } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 646e9d45365..525c265d607 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -108,14 +108,14 @@ public: virtual int GetGameObjectType() { return OBJ_ARMATURE; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON // PYTHON static PyObject* pyattr_get_constraints(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_channels(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); KX_PYMETHOD_DOC_NOARGS(BL_ArmatureObject, update); -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: /* list element: BL_ArmatureConstraint. Use SG_DListHead to have automatic list replication */ diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 08d3e54a7c5..ccd7dc6f745 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -408,7 +408,7 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) return keepgoing; }; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* ------------------------------------------------------------------------- */ /* Python functions */ @@ -491,4 +491,4 @@ int BL_ShapeActionActuator::pyattr_set_action(void *self_v, const KX_PYATTRIBUTE } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 64cd21e5544..e6457e2c686 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -82,7 +82,7 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); @@ -125,7 +125,7 @@ public: } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON protected: diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index a23629e3341..9e0b4242f28 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -85,8 +85,7 @@ SET(SRC IF(WITH_PYTHON) LIST(APPEND INC ${PYTHON_INC}) -ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DWITH_PYTHON) ENDIF(WITH_PYTHON) IF(WITH_BULLET) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 7ec7104f1f4..05b0e75b070 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -906,7 +906,7 @@ void KX_BlenderSceneConverter::TestHandlesPhysicsObjectToAnimationIpo() } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *KX_BlenderSceneConverter::GetPyNamespace() { return m_ketsjiEngine->GetPyNamespace(); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 20f3f863563..8692a75ecb6 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -174,7 +174,7 @@ public: -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON PyObject *GetPyNamespace(); #endif diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp index a6b62ecb7b0..3bca6b9ab11 100644 --- a/source/gameengine/Converter/KX_ConvertControllers.cpp +++ b/source/gameengine/Converter/KX_ConvertControllers.cpp @@ -153,7 +153,7 @@ void BL_ConvertControllers( bPythonCont* pycont = (bPythonCont*) bcontr->data; SCA_PythonController* pyctrl = new SCA_PythonController(gameobj, pycont->mode); gamecontroller = pyctrl; -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON pyctrl->SetNamespace(converter->GetPyNamespace()); @@ -183,7 +183,7 @@ void BL_ConvertControllers( } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON break; } @@ -210,7 +210,7 @@ void BL_ConvertControllers( converter->RegisterGameController(gamecontroller, bcontr); -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON if (bcontr->type==CONT_PYTHON) { SCA_PythonController *pyctrl= static_cast<SCA_PythonController*>(gamecontroller); /* not strictly needed but gives syntax errors early on and @@ -225,7 +225,7 @@ void BL_ConvertControllers( // pyctrl->Import(); } } -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON //done with gamecontroller gamecontroller->Release(); diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index 44c0ad38909..6c850008e5e 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -126,7 +126,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan propval->Release(); } -#ifndef DISABLE_PYTHON +#ifdef WITH_PYTHON /* Warn if we double up on attributes, this isnt quite right since it wont find inherited attributes however there arnt many */ for(PyAttributeDef *attrdef = KX_GameObject::Attributes; attrdef->m_name; attrdef++) { if(strcmp(prop->name, attrdef->m_name)==0) { @@ -141,7 +141,7 @@ void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventMan } } /* end warning check */ -#endif // DISABLE_PYTHON +#endif // WITH_PYTHON prop = prop->next; } diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index a276d1623df..f6cf2331a43 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -29,8 +29,7 @@ if env['BF_DEBUG']: if env['WITH_BF_PYTHON']: incs += ' ' + env['BF_PYTHON_INC'] -else: - defs.append('DISABLE_PYTHON') + defs.append('WITH_PYTHON') if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') |