This patch adds the submodule app to bge. apps contains constants similar to bpy.app, particularly version (tuple of three ints like 2.75.1).
It was requested in T43918 and set as TODO.
The patch also adds rst doc for the module.
Differential D1348
BGE: Fix T43918: adding submodule bge.app including attribute version. Authored by Quentin Wenger (Matpi) on Jun 10 2015, 6:36 PM.
Details
This patch adds the submodule app to bge. apps contains constants similar to bpy.app, particularly version (tuple of three ints like 2.75.1). It was requested in T43918 and set as TODO. The patch also adds rst doc for the module.
Diff Detail
Event TimelineComment Actions Thanks! As for the example: well... not really... I picked up this task because there were a TODO and a feature request about it... So there probably are people looking for it... I think the main idea is to be able to check if a feature is available or not, etc. But of course, if Blender's version is lower than the current one, this function won't be present either. :-/ Maybe you should ask @Marcin Nijaki (marcino15) directly. Comment Actions It looks ok to me An example would be: when a game has been deployed and you need to update blenderplayer for bugfixing purposes then a simple way to know if it is necessary to update your blenderplayer executable is to compare which blender version you have installed against bugfixing version. Comment Actions Game developpers use at least the lastest blender version, no ? so they don't need this check if the bug is fixed in lastest versions. And if is a lambda user who only play the game, the blender and blenderplayer are generaly provided with the game. Comment Actions I mean: a gamer launch his BGE "AAA" game :-), then the game connect itself to a server to check for updates (blends or executable). Then a way to know if you game needs to be updated is to know which version your game is. Comment Actions @Porteries Tristan (panzergame), Suggest to have bge.app.version for application level info. Check how bpy.app is implemented. source/blender/python/intern/bpy_app.c Comment Actions Ok. Should we agree on other elements to port from bpy.app? Like all three bpy.app.version_*, some of the bpy.app.build_*, etc.? Comment Actions if there are others that make sense to add, you could suggest - but dont think this is a requirement. (others can be added as neeeded, as we did for bpy.app). Note, dont think this should fully duplicate bpy.app, a lot of vars there dont make sense for BGE. Comment Actions Updated the diff to reflect changes that have been asked for. I implemented following attributes:
Notes:
Also updated Revision title & summary. Comment Actions note on sdl/bullet/ffmpeg... it could be nicer to check feature support. EG: has_joystick has_physics has_texture_video Comment Actions Note, not sure about has_sound, Its currently impossible to compile BGE without WITH_AUDASPACE.
Comment Actions About has_sound: you're right as for the current status, but I have seen many checks for WITH_AUDASPACE in the BGE code. Is is such a problem to have an attribute (currently) always set to True?
Comment Actions would just avoid adding useless options here. anyone who reads API docs may investigate when has_sound needs to be checked... only to find never. Simple rule - only add useful attributes. | ||||||||||||||||||||||