Blender Git Commit Log

Git Commits -> Revision 33b974e

Revision 33b974e by Campbell Barton (master)
May 26, 2009, 16:15 (GMT)
BGE Py API
- Deprecation warnings for using attribute access

- Added dictionary functions to KX_GameObject and ListValue
ob.get(key, default=None)
ob.has_key(key)
ob.has_key is important since there was no way to do something like hasattr(ob, "attr") which can be replaced by ob.has_key("attr") - (both still work of course).
ob.get is just useful in many cases where you want a property if it exists but can fallback to a default.

- CListValue::FindValue was adding a reference but the ~3 places it was used were releasing the reference. added a FindValue that accepts a const char* type to avoid converting python strings to STR_String.

Commit Details:

Full Hash: 33b974ee43c2d6c131860efbe02fd478197b9fda
SVN Revision: 20426
Parent Commit: 7e48820
Lines Changed: +132, -22

7 Modified Paths:

/source/gameengine/Expressions/ListValue.cpp (+45, -20) (Diff)
/source/gameengine/Expressions/ListValue.h (+3, -0) (Diff)
/source/gameengine/Expressions/Value.cpp (+6, -0) (Diff)
/source/gameengine/Ketsji/KX_BlenderMaterial.cpp (+0, -1) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+49, -1) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+5, -0) (Diff)
/source/gameengine/PyDoc/GameTypes.py (+24, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021