[Bf-committers] [patch] A patch to add KX_KetsjiEngine::ShowDeprecationWarning()

Dalai Felinto dfelinto at gmail.com
Wed Dec 17 08:24:58 CET 2008

I like this idea but we may need another function call slightly different.

For example we have getDistance() (give you the distance), getVectTo()
(give you the vector and the distance) and MathUtils that allow you to
get the same data.
IMHO it would be nice to centralize these calls (right now if we run a
`print dir(obj)` we have so much functions that I found myself

Another example(from the top of my head) could be the RayCast and
RayCastTo. Could you unify them as well?

Therefore I suggest to also create ShowDeprecationWarning(STR_String).
The ShowDeprecationWarning(STR_String, STR_String) being used for
general cases, and the other one for more specific ones.

my 2 cents,
(I didn't look to the patch though)

Dalai Felinto

2008/12/16 Mitchell Stokes <mitchell at daboys4u.com>:
> >From the tracker
> (https://projects.blender.org/tracker/index.php?func=detail&aid=18097&group_id=9&atid=306):
> "In order to clean up the BGE Python API, me and cyborg_ar needed a way to
> tell users that they were using a deprecated
> function and should use another one.
> Just put this into a deprecated function:
> KX_KetsjiEngine::ShowDeprecationWarning("old way", "new way");
> For example:
> KX_KetsjiEngine::ShowDeprecationWarning("getPosition()", "position
> property");
> Will print "Method getPosition() is deprecated, please use the position
> property instead" to the console.
> The warnings can be turned off with Game -> Ignore Deprecation Warnings."
> -Mitchell "Moguri" Stokes
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers

More information about the Bf-committers mailing list