[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22766] trunk/blender/source/gameengine: removing GameLogic.EvalExpression(),

Campbell Barton ideasman42 at gmail.com
Tue Aug 25 17:22:28 CEST 2009


correction,
memory leak is possible but unlikely

On Tue, Aug 25, 2009 at 5:43 AM, Campbell Barton<ideasman42 at gmail.com> wrote:
> Revision: 22766
>          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22766
> Author:   campbellbarton
> Date:     2009-08-25 14:43:25 +0200 (Tue, 25 Aug 2009)
>
> Log Message:
> -----------
> removing GameLogic.EvalExpression(),
> unlikely anyone will miss it, was only accessible in 2.49, invalid expressions would crash, valid ones leak memory.
>
> Modified Paths:
> --------------
>    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
>    trunk/blender/source/gameengine/PyDoc/GameLogic.py
>
> Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
> ===================================================================
> --- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2009-08-25 12:31:35 UTC (rev 22765)
> +++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2009-08-25 12:43:25 UTC (rev 22766)
> @@ -498,33 +498,6 @@
>        Py_RETURN_NONE;
>  }
>
> -
> -static PyObject *gEvalExpression(PyObject*, PyObject* value)
> -{
> -       char* txt= PyString_AsString(value);
> -
> -       if (txt==NULL) {
> -               PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument");
> -               return NULL;
> -       }
> -
> -       CParser parser;
> -       CExpression* expr = parser.ProcessText(txt);
> -       CValue* val = expr->Calculate();
> -       expr->Release();
> -
> -       if (val) {
> -               PyObject* pyobj = val->ConvertValueToPython();
> -               if (pyobj)
> -                       return pyobj;
> -               else
> -                       return val->GetProxy();
> -       }
> -
> -       Py_RETURN_NONE;
> -}
> -
> -
>  static struct PyMethodDef game_methods[] = {
>        {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (PY_METHODCHAR)gPyExpandPath_doc},
>        {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (PY_METHODCHAR)gPySendMessage_doc},
> @@ -553,7 +526,6 @@
>        {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (PY_METHODCHAR)"Gets the estimated average frame rate"},
>        {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (PY_METHODCHAR)"Gets a list of blend files in the same directory as the current blend file"},
>        {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (PY_METHODCHAR)"Prints GL Extension Info"},
> -       {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (PY_METHODCHAR)"Evaluate a string as a game logic expression"},
>        {NULL, (PyCFunction) NULL, 0, NULL }
>  };
>
>
> Modified: trunk/blender/source/gameengine/PyDoc/GameLogic.py
> ===================================================================
> --- trunk/blender/source/gameengine/PyDoc/GameLogic.py  2009-08-25 12:31:35 UTC (rev 22765)
> +++ trunk/blender/source/gameengine/PyDoc/GameLogic.py  2009-08-25 12:43:25 UTC (rev 22766)
> @@ -448,14 +448,6 @@
>        @type ticrate: float
>        """
>
> -def EvalExpression(text):
> -       """
> -       Evaluate the string as an expression, similar to the expression controller logic brick.
> -       @param text: The expression to evaluate.
> -       @type text: string
> -       @return: The result of the expression. The type depends on the expression.
> -       """
> -
>  #{ Utility functions
>  def getAverageFrameRate():
>        """
>
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>



-- 
- Campbell



More information about the Bf-blender-cvs mailing list