diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-25 17:43:21 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-25 17:43:21 +0400 |
commit | 855974dad931bcba8a63260d1f642da49902d569 (patch) | |
tree | 09f71f7f16aee22229f41e91583a1535ce701b7a /source/gameengine/PyDoc | |
parent | 8aa6f672bab266986c7d775cfb01c48d834d3ad9 (diff) |
patch from Mitchell Stokes adding dictionary like access to a scene. (like KX_GameObjects have)
val = scene["prop"]
scene["prop"] = newval
if "prop" in scene: ...
val = scene.get("prop", fallback_val)
Diffstat (limited to 'source/gameengine/PyDoc')
-rw-r--r-- | source/gameengine/PyDoc/GameTypes.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index c82623e6409..9c426aed8e0 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -3868,6 +3868,12 @@ class KX_Scene(PyObjectPlus): @rtype: L{KX_GameObject} """ + + def get(key, default=None): + """ + Return the value matching key, or the default value if its not found. + @return: The key value or a default. + """ class KX_SceneActuator(SCA_IActuator): """ |