This Patch will add a the world API (mist, background, ambient) to KX_WorldInfo.
The new API uses now attributes.
Details
Diff Detail
Event Timeline
The implementation looks ok to me but I'm not familiar with the BGE API conventions, so I will let the game engine developers judge if this is something they want.
Our current naming convention for the BGE Python API is a Javaesque camelCase, not the Pythonic PEP8 naming convention used by bpy (which is preferred). It would be nice to switch the naming convention, but not at the expense of breaking scripts. We do have some items in our API that break our current naming convention (e.g., LibLoad, KX_Light.lin_attenuation, KX_Light.quad_attenuation, etc.). Part of me would like to keep the naming convention is this revision as is to slowly transition naming conventions, but that would be horribly inconsistent with the rest of the API. I'll add Campbell as a reviewer so we can get his opinion.
We have a deprecation mechanism in the form of the ShowDeprecationWarning macro in PyObjectPlus.h. This macro should be used in each deprecated function so users get a warning when attempting to use the deprecated functions (this is what we used with the big API changes for 2.49).
| doc/python_api/rst/bge_types/bge.types.KX_Scene.rst | ||
|---|---|---|
| 90 | This doc doesn't match the actual code, which only returns a single KX_WorldInfo object. | |
| doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst | ||
| 18 | bge.logic.getCurrentScene() does not return a list, so leave off the indexing. | |
| 20 | Shouldn't this be sce.world.mist_color? | |
Fixed bugs that Moguri found.
Renamed KX_Scene to KX_WorldInfo.
Add method to return word name.
If no world exist none type will be returned.
You should make sure the old bge.render API prints deprecation warnings using the ShowDeprecationWarning macro in PyObjectPlus.h.
Looks good to me. It might be worthwhile to explore exposing some of these as mathutils in another patch.
I'd like to have Campbell's approval before this patch is actually landed.
As requested from Mogury on IRC, I have changed thecolor return type to mathutils vector.