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-16 11:16:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-06-16 11:16:51 +0400
commit2ecbe1c81cec6f537aa10829e94fbc451f9bc823 (patch)
treefeba81632819f672cc62b118b5f73e2e2193d2cf /source/gameengine/Expressions/InputParser.cpp
parent6efd2e643953b293aaf7ef0de50d08badd2f49a8 (diff)
BGE Py API
* Removed modules Expression and CValue, neither were ever available. * Added GameLogic.EvalExpression(exp) from the Expression module, evaluates an expression like the expression controller (not sure if this is really that useful since python is far more advanced). * resetting the original blend file path didint work (own fault == -> =) * Py3.x PyModule_Create didnt allow importing since it didn't add to sys.modules, Looks like they want us to use init-tab array, but this doesn't suit us since it needs to be setup before python is initialized. * Documented GameLogic.globalDict
Diffstat (limited to 'source/gameengine/Expressions/InputParser.cpp')
-rw-r--r--source/gameengine/Expressions/InputParser.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index b15b206a38a..96a52aec028 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -636,63 +636,3 @@ void CParser::SetContext(CValue* context)
}
m_identifierContext = context;
}
-
-
-
-
-PyObject* CParserPyMake(PyObject* ignored,PyObject* args)
-{
- char* txt;
- if (!PyArg_ParseTuple(args,"s",&txt))
- return NULL;
- CParser parser;
- CExpression* expr = parser.ProcessText(txt);
- CValue* val = expr->Calculate();
- expr->Release();
- return val->GetProxy();
-}
-
-static PyMethodDef CParserMethods[] =
-{
- { "calc", CParserPyMake , METH_VARARGS},
- { NULL,NULL} // Sentinel
-};
-
-
-#if (PY_VERSION_HEX >= 0x03000000)
-static struct PyModuleDef Expression_module_def = {
- {}, /* m_base */
- "Expression", /* m_name */
- 0, /* m_doc */
- 0, /* m_size */
- CParserMethods, /* m_methods */
- 0, /* m_reload */
- 0, /* m_traverse */
- 0, /* m_clear */
- 0, /* m_free */
-};
-#endif
-
-extern "C" {
- void initExpressionModule(void)
- {
- PyObject *m;
- /* Use existing module where possible
- * be careful not to init any runtime vars after this */
- m = PyImport_ImportModule( "Expression" );
- if(m) {
- Py_DECREF(m);
- //return m;
- }
- else {
- PyErr_Clear();
-
-#if (PY_VERSION_HEX >= 0x03000000)
- PyModule_Create(&Expression_module_def);
-#else
- Py_InitModule("Expression",CParserMethods);
-#endif
- }
- }
-}
-