Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-12-12BGE: Improve clock managementArnaud Degroote
This patch improves clock management in BGE, to be able to accelerate / slow the time, and also to finely synchronize clock with external engines. Several new python functions have been added and existence ones have been improved for that purpose. Now we have: - getClockTime(): Get the current BGE render time, in seconds. The BGE render time is the simulation time corresponding to the next scene that will be rendered. - getFrameTime(): Get the current BGE frame time, in seconds. The BGE frame time is the simulation time corresponding to the current call of the logic system. Generally speaking, it is what the user is interested in. - getRealTime(): Get the number of real (system-clock) seconds elapsed since the beginning of the simulation. - getTimeScale(): Get the time multiplier between real-time and simulation time. The default value is 1.0. A value greater than 1.0 means that the simulation is going faster than real-time, a value lower than 1.0 means that the simulation is going slower than real-time. - setTimeScale(time_scale): Set the time multiplier between real-time and simulation time. A value greater than 1.0 means that the simulation is going faster than real-time, a value lower than 1.0 means that the simulation is going slower than real-time. Note that a too large value may lead to some physics instabilities. - getUseExternalClock(): Get if the BGE use the inner BGE clock, or rely or on an external clock. The default is to use the inner BGE clock. - setUseExternalClock(use_external_clock): Set if the BGE use the inner BGE clock, or rely or on an external clock. If the user selects the use of an external clock, he should call regularly the setClockTime method. - setClockTime(new_time): Set the next value of the simulation clock. It is preferable to use this method from a custom main function in python, as calling it in the logic block can easily lead to a blocked system (if the time does not advance enough to run at least the next logic step). Rationale are described more precisely in the thread http://lists.blender.org/pipermail/bf-gamedev/2013-November/000165.html. See also T37640 Reviewers: sybren, panzergame, #game_engine, lordloki, moguri Reviewed By: sybren, panzergame, #game_engine, lordloki, moguri Subscribers: moguri, hg1, sybren, panzergame, dfelinto, lordloki Projects: #game_engine Maniphest Tasks: T37640 Differential Revision: https://developer.blender.org/D728
2015-10-27BGE: Fix T31357: wrong zoom when sets camera.Porteries Tristan
This patch makes independant the override camera zoom and the default camera object zoom. The override zoom is 2.0f and the camera object zoom is computed with the RegionView3D camera zoom. These features are only used for the embedded BGE, so there's no compatibility issues with the blenderplayer. I let the override zoom with a setter to allow later to create an override camera in blenderplayer easily. Tested with the 3 framing modes in embedded and standalone.
2015-08-25BGE: added bge.logic.{get,set}AnimRecordFrame functionsSybren A. Stüvel
By using getAnimRecordFrame(), game developers have access to the frame number used by the "Record animation" feature. This enables them to record additional information in Blender's F-Curves and ensuring perfect synchronization with the information already recorded by Blender. The setAnimRecordFrame() can be used to change the frame number at which animations are recorded, for example to introduce delays the recording that do not require delays in the actual game/simulation run. The getter/setter functions in KX_KetsjiEngine are not directly named after property they access (m_currentFrame). I found "current frame" to be too vague for a public interface, hence chose a more descriptive name. Reviewers: moguri, hg1, campbellbarton, panzergame, aligorith Reviewed By: panzergame, aligorith Differential Revision: https://developer.blender.org/D1449
2015-08-06Cleanup: whitespaceCampbell Barton
2015-07-12BGE Clean-up: New EXP prefix for the BGE Expression moduleJorge Bernal
The expression module now uses an EXP prefix and it follows a distribution similar to blender. Additionally the hash function in EXP_HashedPtr.h was simplified and the files EXP_C-Api.h &.EXP_C-Api.cpp were deleted because were unused. Reviewers: campbellbarton, moguri, sybren, hg1 Projects: #game_engine Differential Revision: https://developer.blender.org/D1221
2015-06-22BGE: Fix T45110, T44174, armature animations update and mirror render.Porteries Tristan
Reveiwers:Moguri, Matpi, youle
2015-03-24BGE: Code clean up for world (mist, background, ambient)Thomas Szepe
Code clean up for BGE world mist, background and global ambient color. Move mist render update to BlenderWolrdInfo Reviewers: moguri, brecht Reviewed By: moguri, brecht Differential Revision: https://developer.blender.org/D152
2015-01-08Revert "Fix T40257: Frustum culling not working properly"Mitchell Stokes
This reverts commit 315609ec0c1e28eb12bde3e8bbd2a5b03672b1a9. This fix still causes more issues than it solves.
2014-08-23BGE: fix crash and return boolean on scene.replace()Benoit Bolsee
Scene replacement with invalid scene name was crashing blender, now it's a no-op. KS_Scene.replace() to return a boolean to indicate if the scene is valid and is scheduled for replacement. This allows more robust game management.
2014-07-16Fix T40146: BGE Compound parent crashMitchell Stokes
2014-07-12BGE debug API and actuatorHG1
This patch adds some new debug methods to the KX_GameObject for manually adding the debug list and bge.render for controlling the debug visualization. It also adds a new debug actuator, which allows to control the same functions. This patch is a updated version of T33701. Thread on Blenderartists: http://blenderartists.org/forum/showthread.php?264745-Debug-proerties-for-added-objects-patch&p=2256018&viewfull=1#post2256018 Reviewers: moguri Reviewed By: moguri Differential Revision: https://developer.blender.org/D635
2014-07-11Fix T40257: Frustum culling not working properlyMitchell Stokes
This is mostly the same fix as before, but now code depending on culling checks is executed after KX_Scene->CalculateVisibleMeshes(). As a side-effect, LoD checks and animation culling now use the current frame's culling information rather than the previous frame's.
2014-04-07BGE: Multi-threading animation updates and skinning.Mitchell Stokes
This required BL_ArmatureObject to have tighter control over armatures and poses. Also, (Blender) armature objects are now copied instead of shared between BL_ArmatureObjects to avoid race conditions. Also, due to the armature copy, shape key drivers need a bit of extra fiddling to get the correct armature copy. Initially OpenMP was used for threading, but then BLI_task was used due to being less compiler dependent. This commit also places time spent on skinning updates in the Animation profiler category (was previously under the Rasterizer category).
2014-03-25Code cleanup: Removing KX_KetsjiEngine::m_drawingmodeMitchell Stokes
The rasterizer is already handling this, and there is no need to duplicate the data.
2013-11-04BGE Rasterizer Cleanup: Removing RAS_IRenderTools and moving the ↵Mitchell Stokes
functionality to RAS_IRasterizer. RAS_OpenGLRasterizer is a bit of a mess now with references to Ketsji and other modules it shouldn't be accessing.
2013-08-13BGE: Adding a GPU Latency profile category to represent the CPU time spent ↵Mitchell Stokes
waiting on the graphics card.
2013-07-10BGE: Committing patch #32422 "Debug properties for added objects" by HG1.Mitchell Stokes
This patch allows debug properties from objects added to the scene at runtime to be displayed under the Debug Properties in the overhead display.
2013-06-20BGE: Fix for [#34781] "bge.texture.ImageRender does not show Font object" ↵Mitchell Stokes
reported by Monster. This fix is mostly based off of HG1's patch from the bug report, which had ImageRender::Render() call KX_KetsjiEngine::RenderFonts(). However, I have moved RenderFonts() from KX_KetsjiEngine to KX_Scene where all of the other font and rendering functions are. The real fix for this mess would be to not have ImageRender::Render() have so much duplicate code from KX_KetsjiEngine::Render(), but that's a code cleanup problem for another day.
2013-06-18BGE: Fix for [#32218] "logic.addScene() Not Adding Scenes in Order" reported ↵Mitchell Stokes
by Josiah Lane (solarlune). Adding scenes now uses a vector instead of a set to maintain order. This fix is partly based off of patch #32297 by Pavel Sadikov (sigmat).
2013-04-12bge fix: framing mode "Expanded" not updated when resizing blenderplayerDalai Felinto
now, with a 'resize' routine for the engine we can/should also recreate some buffers that are created only at init time (e.g., 2d filters, dome fbos, ...). This bug was always present in Blender (since 2.49 at least). Bugfix supported by NF-UBC Nereus Program as part of the development of OceanViz/NereusViz
2013-03-19BGE: Adding a getProfileInfo() function to bge.logic. This function returns ↵Mitchell Stokes
a Python dictionary with the same information as the on screen profiler.
2012-12-19BGE: Some as of yet unmerged work I did in the Swiss branch. These changes ↵Mitchell Stokes
include: * Cleaning up the conversion code to avoid a per-face material conversion. Materials are now stored in buckets and only converted if a new material is found. This replaces some of Campbell's earlier work on the subject. His work wasn't as thorough, but it was much safer for a release. * Shaders are only compiled for LibLoaded materials once. Before they could be compiled twice, which could really slow things down. * Refactoring the rasterizer code to use a strategy design pattern to handle different geometry rendering methods such as immediate mode, vertex arrays and vertex buffer objects. VBOs are added, but they will be disabled in a following commit since they are still slower than vertex arrays with display lists. However, VBOs are still useful for mobile, so it's good to keep them around. * Better multi-uv support. The BGE should now be able to handle more than two UV layers, which should help it better match the viewport.
2012-10-09code cleanup: make header defines more consistent, JOYSENSOR header guard ↵Campbell Barton
had a typo too.
2012-09-16style cleanupCampbell Barton
2012-06-25optionally use guarded alloc for tiles compositor, also replace allocation ↵Campbell Barton
functions with a macro.
2012-06-07style cleanupCampbell Barton
2012-03-18spelling cleanupCampbell Barton
2012-03-08style cleanup - remove unneeded ';'sCampbell Barton
2012-03-02style cleanupCampbell Barton
- spelling - turns out we had tessellation spelt wrong all over. - use \directive for doxy (not @directive) - remove BLI_sparsemap.h - was from bmesh merge IIRC but entire file commented and not used.
2012-02-23use __ prefix on header guards to avoid mixing up defines with api functions ↵Campbell Barton
/ classes.
2011-12-20Cucumber, first batch of merge - UI changes and custom exit keyDalai Felinto
--------------------------------------------------------------- This was a test drive to see how painful the merge will be. Next batches are: - use desktop option for fullscreen - multisampling option - bullet collision mask - python - storage (vbo, dl, ...) - lighting [lighting still needs review] [python could use review, although it should be straightforward] [storage should be tested more I think] Merged /branches/soc-2011-cucumber:r 36991,37059,37157,37416,37497-37499,37501,37522,39036,40593 36991: ==UI== * Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps) * Created a panel for the embedded player * Renamed the FPS option for the standalone player to Refresh Rate * Moved framing options to display * Made a button to launch the blender player from within blender (only tested on windows for now) 37059: ==UI== * Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come. * Removed the physics settings from the scene panel for the BGE. * Added an Add menu in the logic brick header. 37157: Making the bake options available in Blender Game 37416: Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting) 37497: Some more work on getting the exit key to work in the Blenderplayer. Input is now restricted to keyboard events only for the exit key UI. 37498: Some clean up from the last commit. The exit key setting affects the Blenderplayer now. 37499: Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter. 37501: Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API. [37517: committed previously] 37522: Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine. Added setExitKey and getExitKey to the python API 39036: A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set. [not committed entirely, see below]] 40552: space_logic.py (* fixed an error in space_logic.py *) 40593: launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me ######################################################## code left behind (to be included in next commit): ######################################################## { /* Initialize default values for collision masks */ Object *ob; for(ob=main->object.first; ob; ob=ob->id.next) ob->col_group = ob->col_mask = 1; }
2011-11-05misc doc editsCampbell Barton
- remove recently added sphinx reference workaround. - tested doxygen, correct some warnings, set tab width and added pymathutils group. - added convenience target 'make doc_doxy'
2011-10-23remove $Id: tags after discussion on the mailign list: ↵Campbell Barton
http://markmail.org/message/fp7ozcywxum3ar7n
2011-09-11bugfix: [bf-blender-Game Engine][28167] Restart game actuator don't get ↵Dalai Felinto
changed material mode http://projects.blender.org/tracker/?func=detail&aid=28167&group_id=9&atid=306 Game Actuator (restart or load a new file) will not keep some settings alive (as we had in 2.49). In 2.49 the solution used was to use Blender globals (G.fileflags) to get/set those settings. That was causing the blender file to change if you change the material mode from the game. In 2.5 this never worked, and the implementation was buggy (it's relying in the scene settings, which get reset ever time we restart/load a new file). My idea for fixing this is to create a new struct (GlobalSettings) where we store any setting to be preserver during the course of the game. This is specially important for options that require the game to restart/load new file (graphic ones). But it later can be expanded to support other things such as audio settings (e.g. volume), ... I'm also planning to expand it for stereo and dome settings, but I prefer to first get this committed and then build a new patch on top of that. I had some problems in finding a correct way for build/link the blenderplayer changes, so although it's working I'm not sure this is the best code (e.g. I couldn't make forward declaration to work in GPG_Application.h for the struct GlobalSettings so I ended up including KX_KetsjiEngine.h) [note: I talked with Brecht and he find this is an ok solution. He implemented it originally so it's good to have his go. However I still think there must be a way to make forward declaration to work. I will see with other devs if there is a better solution] [also I'm likely renaming glsl to flags later if there are more settings stored in the flags to be used. But for now we are only handling glsl flags]
2011-08-28* Removing mocap GSoC (is an addon already).Joerg Mueller
* Fixing ffmpeg-0.8 errors. * Fixing Ketsji paths. * Removing DoSound from BGE. * Fixing audio scene update to use only current scene objects.
2011-08-13BGE Animations: Adding an option to let users choose whether or not to lock ↵Mitchell Stokes
animation updates to the framerate. If this option is enabled, animations are only updated at the same speed as the animation framerate. This can give a significant speed up in performance, but at the cost of smoothness in animations. I'm defaulting this behavior to off for now, which is the behavior seen in trunk.
2011-07-14BGE Animations: Now animations are only updated based on the set animation ↵Mitchell Stokes
speed. This offers a significant performance increase (about 2x fps in my animation stress tests) for cases such as the defaults: 60fps logic and 30fps animations. This means that animations now only have to be updated half the time. I've also added Animations as a profiling category. This is the time spent in Blender's animation code, and not in the BL_ShapeDeformer (the mesh deformation). I'd like the add the deformation too, but right now it's counted in the rasterizer, and I don't see an obviously clean way to have it counted as animation instead. I'll investigate more.
2011-02-22doxygen: entries for blenderroutines, converter, expressions, gamelogic, ↵Nathan Letwory
gameplayer, ketsji
2010-12-16Patch:[#25163] BGE support for Blender Font objects - unicode supportDalai Felinto
Problem/Bug: ------------ There were no way to have proper unicode characters (e.g. Japanese) in Blender Game Engine. Now we can :) You can see a sample here: http://blog.mikepan.com/multi-language-support-in-blender/ Functionality Explanation: -------------------------- This patch converts the Blender Font Objects to a new BGE type: KX_FontObject This object inherits KX_GameObject.cpp and has the following properties: - text (the text of the object) - size (taken from the Blender object, usually is 1.0) - resolution (1.0 by default, maybe not really needed, but at least for debugging/the time being it's nice to have) The way we deal with linked objects is different than Blender. In Blender the text and size are a property of the Text databock. Therefore linked objects necessarily share the same text (and size, although the size of the object datablock affects that too). In BGE they are stored and accessed per object. Without that it would be problematic to have addObject adding texts that don't share the same data. Known problems/limitations/ToDo: -------------------------------- 1) support for packed font and the <builtin> 2) figure why some fonts are displayed in a different size in 3DView/BGE (BLF) 3) investigate some glitches I see some times 4) support for multiline 5) support for more Blender Font Object options (text aligment, text boxes, ...) [1] Diego (bdiego) evantually will help on that. For the time being we are using the "default" (ui) font to replace the <builtin>. [2] but not all of them. I need to cross check who is calculating the size/dpi in/correctly - Blender or BLF. (e.g. fonts that work well - MS Gothic) [3] I think this may be related to the resolution we are drawing the font [4] It can't/will not be handled inside BFL. So the way I see it is to implement a mini text library/api that works as a middlelayer between the drawing step and BLF. So instead of: BLF_draw(fontid, (char *)text, strlen(text)); We would do: MAGIC_ROUTINE_IM_NOT_BLF_draw(fontir, (char *)text, styleflag, width, height); [5] don't hold your breath ... but if someone wants to have fun in the holidays the (4) and (5) are part of the same problem. Code Explanation: ----------------- The patch should be simple to read. They are three may parts: 1) BL_BlenderDataConversion.cpp:: converts the OB_FONT object into a KX_FontObject.cpp and store it in the KX_Scene->m_fonts 2) KetsjiEngine.cpp::RenderFonts:: loop through the texts and call their internal drawing routine. 3) KX_FontObject.cpp:: a) constructor: load the font of the object, and store other values. b) DrawText: calculate the aspect for the given size (sounds hacky but this is how blf works) and call the render routine in RenderTools 4) KX_BlenderGL.cpp (called from rendertools) ::BL_print_game_line:: Draws the text. Using the BLF API *) In order to handle visibility of the object added with AddObject I'm adding to the m_scene.m_fonts list only the Fonts in a visible layer - unlike Cameras and Lamps where all the objects are added. Acknowledgements: ---------------- Thanks Benoit for the review and adjustment suggestions. Thanks Diego for the BFL expertise, patches and support (Latin community ftw) Thanks my boss for letting me do part of this patch during work time. Good thing we are starting a project in a partnership with a Japanese Foundation and eventual will need unicode in BGE :) for more details on that - www.nereusprogram.org - let's call it the main sponsor of this "bug feature" ;)
2010-10-31rename and negate DISABLE_PYTHON --> WITH_PYTHONCampbell Barton
2010-08-05bugfix [#23148] "ImportError: __import__ not found" on changing Render FPSCampbell Barton
The BGE was getting the namespace dict directly from __main__ which conflicts with my recent fix to get the pickle module working which to overwrote the __main__ module on script execution. Simple fix is to have the BGE and Blender use the same method of getting namespaces. Renamed CreateGlobalDictionary() to bpy_namespace_dict_new() and moved into bpy_internal_import.c pickle still wont work in the BGE since we make a copy of __main__ namespace but for speed would rather not have to replace the __main__ module many times per second.
2010-06-06- WITH_CXX_GUARDEDALLOC working againCampbell Barton
- CMake building without python or fluidsim working again (broke in recent commit) - remove BLI_short_filename(), it wasnt used anywhere.
2010-04-17Patch #21789 - BGE Keyboard and Mouse Python types - by Mitchell Stokes(Moguri)Dalai Felinto
The patch exposes mouse and keyboard read-only properties in the GameLogic module Also renames bge.keys to bge.events (* Note: name of bge submodules (logic, render, ...) may change before 2.5 final release [right Campbell?]). """ This patch adds two new types to the BGE: SCA_PythonKeyboard SCA_PythonMouse These two types allow users to make use of the keyboard and mouse without the need for a keyboard or mouse sensor. SCA_PythonKeyboard has an events property that acts just like SCA_KeyboardSensor.events. SCA_PythonMouse also has an events property to check for mouse events. Further more it supports getting and setting normalized cursor position (from 0.0 to 1.0) with SCA_PythonMouse.position. The cursor can be shown/hidden using SCA_PythonMouse.visible. """ Its use is similar with current mouse and keyboard controllers. With the exception of mouse position being normalized and writable as well (replacing Rasterizer.setMousePosition). Code Sample: ###### from bge import logic, events mouse = logic.mouse keyboard = logic.keyboard for key,status in keyboard.events: if status == logic.KX_INPUT_JUST_ACTIVATED: if key == events.WKEY: print(mouse.position) # move_forward() mouse.visible = True # turn cursor visible mouse.position = 0.5,0.5 # centralize mouse - use tuple ###### * Important Note: mouse.position still will not work properly for Letterbox mode. In order to fix letterboxing I may need to move the set x,y mouse function to inside the canvas code (to avoid duplicated code between mouse sensor and bge.logic.mouse). I'll leave this for another commit though. Thanks Mitchell for the work on that.
2010-03-03BGE 2D Filters: filters run per scene now (fix for [#18152]) - it (slightly) ↵Dalai Felinto
breaks backward compatibility !!! Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use. (1) Performance - To run the filters 2X == 2X slower (2) flexibility of use - Very often we want the filter in the scene but not in the UI for example. For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now. To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes. * * * * * Imagine that we have: (a) Main Scene (b) Overlay Scene in Main Scene the Z Buffer and RGB will be from the main scene. in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b]. So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
2010-02-22game engine support for recording animation back & some other minor changes.Campbell Barton
2010-02-12correct fsf addressCampbell Barton
2009-11-16BGE: dynamic loading patch commited. API and demo files available here: ↵Benoit Bolsee
https://projects.blender.org/tracker/?func=detail&aid=19492&group_id=9&atid=127
2009-09-30- rather then passing the python namespace dictionary to the controller ↵Campbell Barton
function get the namespace from the converter. - renamed SetPythonDictionary() to SetPyNamespace() - remove IsLight(), GetGameObjectType() existed before this but wasnt used for lights.
2009-09-30option to build the BGE without python, uses existing python check (cmake ↵Campbell Barton
and scons) when python is disabled videotextures are not built.
2009-09-25Merge of itasc branch. Project files, scons and cmake should be working. ↵Benoit Bolsee
Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library.