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
2016-06-11BGE: Various render improvements.Benoit Bolsee
bge.logic.setRender(flag) to enable/disable render. The render pass is enabled by default but it can be disabled with bge.logic.setRender(False). Once disabled, the render pass is skipped and a new logic frame starts immediately. Note that VSync no longer limits the fps when render is off but the 'Use Frame Rate' option in the Render Properties still does. To run as many frames as possible, untick the option This function is useful when you don't need the default render, e.g. when doing offscreen render to an alternate device than the monitor. Note that without VSync, you must limit the frame rate by other means. fbo = bge.render.offScreenCreate(width,height,[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER]) Use this method to create an offscreen buffer of given size, with given MSAA samples and targetting either a render buffer (bge.render.RAS_OFS_RENDER_BUFFER) or a texture (bge.render.RAS_OFS_RENDER_TEXTURE). Use the former if you want to retrieve the frame buffer on the host and the latter if you want to pass the render to another context (texture are proper OGL object, render buffers aren't) The object created by this function can only be used as a parameter of the bge.texture.ImageRender() constructor to send the the render to the FBO rather than to the frame buffer. This is best suited when you want to create a render of specific size, or if you need an image with an alpha channel. bge.texture.<imagetype>.refresh(buffer=None, format="RGBA", ts=-1.0) Without arg, the refresh method of the image objects is pretty much a no-op, it simply invalidates the image so that on next texture refresh, the image will be recalculated. It is now possible to pass an optional buffer object to transfer the image (and recalculate it if it was invalid) to an external object. The object must implement the 'buffer protocol'. The image will be transfered as "RGBA" or "BGRA" pixels depending on format argument (only those 2 formats are supported) and ts is an optional timestamp in the image depends on it (e.g. VideoFFmpeg playing a video file). With this function you don't need anymore to link the image object to a Texture object to use: the image object is self-sufficient. bge.texture.ImageRender(scene, camera, fbo=None) Render to buffer is possible by passing a FBO object (see offScreenCreate). bge.texture.ImageRender.render() Allows asynchronous render: call this method to render the scene but without extracting the pixels yet. The function returns as soon as the render commands have been send to the GPU. The render will proceed asynchronously in the GPU while the host can perform other tasks. To complete the render, you can either call refresh() directly of refresh the texture to which this object is the source. Asynchronous render is useful to achieve optimal performance: call render() on frame N and refresh() on frame N+1 to give as much as time as possible to the GPU to render the frame while the game engine can perform other tasks. Support negative scale on camera. Camera scale was previously ignored in the BGE. It is now injected in the modelview matrix as a vertical or horizontal flip of the scene (respectively if scaleY<0 and scaleX<0). Note that the actual value of the scale is not used, only the sign. This allows to flip the image produced by ImageRender() without any performance degradation: the flip is integrated in the render itself. Optimized image transfer from ImageRender to buffer. Previously, images that were transferred to the host were always going through buffers in VideoTexture. It is now possible to transfer ImageRender images to external buffer without intermediate copy (i.e. directly from OGL to buffer) if the attributes of the ImageRender objects are set as follow: flip=False, alpha=True, scale=False, depth=False, zbuff=False. (if you need to flip the image, use camera negative scale)
2016-04-25Refactor BKE_blender into separate headersCampbell Barton
- BKE_blender_version.h (only version defines & versionstr). - BKE_blender_copybuffer.h (currently only used for view3d copy/paste). - BKE_blender_undo.h (global undo functions). - BKE_blendfile.h (high level blend file read/write API).
2015-12-17Fix T46959: sys.meta_path reset on on exitCampbell Barton
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-12-08BGE code cleanup: Removing RAS_GLExtensionManager.Mitchell Stokes
This class did nothing but print out extensions if they were found. Instead, the code from bge.logic.PrintGLInfo() is now printed as the Rasterizer is initialized. This gives better information, and it removes some GL code from KX_PythonInit.cpp (the PrintGLInfo method now calls the Rasterizer to print the information). Differential Revision: https://developer.blender.org/D438
2015-11-03BGE: Remove KX_IPOActuator.Porteries Tristan
KX_IPOActuator is not used since 2.4. This patch removes: - KX_IPOActuator.h/cpp; - Python doc; - Write of IPO actuator in write.c; - Allocation of IPOactuator in sca.c; - Conversion in KX_ConvertActuators.cpp; - Initialization of the python proxy in KX_PythonInitTypes.cpp; - Other minor remove in logic_windows.c and in KX_PythonInit.cpp. Reviewers: sybren, campbellbarton Reviewed By: campbellbarton Subscribers: moguri Differential Revision: https://developer.blender.org/D1603
2015-10-20Cleanup: remove _POSIX_C_SOURCE undefineCampbell Barton
2015-10-11BGE: Adding a screenshot function to game actuatorThomas Szepe
Extending the existing game actuator with a screenshot function, to give also non programmers the ability to take screenshots in the BGE. Reviewers: lordloki, campbellbarton, moguri Reviewed By: lordloki, moguri Subscribers: lordloki, Genome36 Projects: #game_engine Differential Revision: https://developer.blender.org/D651
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-07-28Audaspace: fixing problems for the merge to master suggested by Campbell and ↵Jörg Müller
Sergey. - rename WITH_EXTERNAL_AUDASPACE to WITH_SYSTEM_AUDASPACE. - rename C/PYAUDASPACE to AUDASPACE_C/PY - simplifying cmake defines and includes. - fixing include paths and enabling WITH_SYSTEM_AUDASPACE for windows. - fixing scons building. - other minor build system fixes.
2015-07-27BGE: Fix T19241: draw debug shape with overlay/background scene.Porteries Tristan
It's for the function render.drawLine and physics debug.
2015-07-26Fix T26141: render setting affects only first scene.Porteries Tristan
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-15BGE: Fix T43918: adding submodule bge.app including attribute version.Porteries Tristan
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. Reviewers: moguri, kupoman, lordloki, panzergame, campbellbarton Reviewed By: lordloki, panzergame, campbellbarton Subscribers: marcino15 Projects: #game_logic, #game_python, #game_engine Differential Revision: https://developer.blender.org/D1348
2015-06-15Fix T44704: BGE regression importing bpy.typesCampbell Barton
2015-06-05BGE: correct ftell use in LoadGlobalDictJorge Bernal
2015-04-07BGE: use tuple for returning display sizeCampbell Barton
2015-04-07BGE: New API method getDisplayDimensionsThomas Szepe
This patch adds a new API function to get the actual display dimensions in pixels. Reviewers: dfelinto, sybren, lordloki, moguri Reviewed By: lordloki, moguri Differential Revision: https://developer.blender.org/D648
2015-04-02CleanupCampbell Barton
2015-03-24BGE: Remove old world bge.render APIThomas Szepe
This patch can be used to remove the old world bge.render API if the new world API D157 is used. If the new world API is applied we can remove the old API because the old has newer worked. The patch keep the two old working methods for backward compatibility. Reviewers: campbellbarton, moguri Reviewed By: campbellbarton, moguri Subscribers: brecht Differential Revision: https://developer.blender.org/D158
2015-03-24BGE: Add new world API KX_WorldInfo (KX_Scene)Thomas Szepe
This Patch will add a the world API (mist, background, ambient) to KX_WorldInfo. The new API uses now attributes. Reviewers: campbellbarton, moguri Reviewed By: moguri Subscribers: klauser, brecht Differential Revision: https://developer.blender.org/D157
2015-03-23BGE: Add setMistType and setMistIntensity API.Thomas Szepe
This patch adds the missing setMistType() and setMistIntensity() to the API Reviewers: campbellbarton, brecht, moguri Reviewed By: campbellbarton, brecht, moguri Subscribers: campbellbarton, dingto Differential Revision: https://developer.blender.org/D149
2015-03-23BGE: Multitexture world (mist, ambient) fixThomas Szepe
This patch fix the existing word API for mist and global ambient lighting. Add deprecated message to disableMist() Add setUseMist(enable). Reviewers: dfelinto, campbellbarton, moguri Reviewed By: moguri Subscribers: solarlune, jta, brecht Projects: #bf_blender:_next Differential Revision: https://developer.blender.org/D148
2015-03-09Fix BGE: calling ReleaseInstance on NULL joystickCampbell Barton
2015-02-09Recreating bge python modules instead of using existingInes Almeida
All of the initXPythonBinding functions are changed to always creating the module instead of importing if previously existing. I can instead only remove the module return when the import is ok, so that it always inits. But then, I don't see the point in importing. I make sure that these functions are called only once per run, inside initBGE. This was not the case with GameTypes. I moved initPyTypes inside of initGameTypesPythonBinding due to that. I reorganized initGamePlayerPythonScripting and initGamePythonScripting so that they run things in the same order. initGamePlayerPythonScripting imports mathutils and aud, the other only aud. Shouldn't it be the same for both? Reviewers: campbellbarton Subscribers: sybren Projects: #game_engine, #game_python Differential Revision: https://developer.blender.org/D1070
2015-02-03BGE: python API initialization cleanupInes Almeida
The goal of these changes is to Close T40132 and to get rid of the 'PyRun_SimpleString' Hilighted changes are: - consistent naming and initialization of BGE submodules - initialization of the 'bge' module as a proper module - using PyDoc_STRVAR instead of static char* - generic cleanup (unused arguments, logica ordering, naming and whitespace) Reviewers: campbellbarton Maniphest Tasks: T40132 Differential Revision: https://developer.blender.org/D983
2015-02-03BGE: python API cleanup - initialization for bge with submodules, closes D615Ines Almeida
2015-02-03BGE: python API cleanup - replace BLI_program_path with BKE_appdir_program_pathInes Almeida
2015-02-03BGE: python API cleanup - bge submodules definitionsInes Almeida
2015-02-03BGE: python API cleanup - using PyDoc_STRVAR instead of static char*Ines Almeida
Cherry-picking d503f8a onto 117edbb Conflicts: source/gameengine/Ketsji/KX_PythonInit.cpp
2015-02-03BGE: python API initialization cleanupInes Almeida
-Removing unused parameters -Updating some parts to match bpy_interface.c initialization Cherry-picking 14fceb6 onto 117edbb Conflicts: source/gameengine/Ketsji/KX_PythonInit.cpp
2015-01-22bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYEDalai Felinto
This function allows the user to run specific code for each of the rendered stereoscopic eyes in the Game Engine. The initial use case is to set the camera projection matrix in a scene.pre_draw callback function for each eye, to be used in VR (Virtual Reality) installations. Reviewed by Mitchell Stokes and Campbell Barton, thank you guys. Sample Test Python Script: """ import bge import bgl import blf def init(): """init function - runs once""" scene = bge.logic.getCurrentScene() scene.post_draw.append(write) def write(): """write on screen - depending on the eye""" width = bge.render.getWindowWidth() height = bge.render.getWindowHeight() # OpenGL setup bgl.glMatrixMode(bgl.GL_PROJECTION) bgl.glLoadIdentity() bgl.gluOrtho2D(0, width, 0, height) bgl.glMatrixMode(bgl.GL_MODELVIEW) bgl.glLoadIdentity() eye = bge.render.getStereoEye() if eye == bge.render.LEFT_EYE: blf.position(0, (width * 0.2), (height * 0.3), 0) blf.size(0, 40, 72) blf.draw(0, "Left") else: # bge.render.RIGHT_EYE: blf.position(0, (width * 0.7), (height * 0.3), 0) blf.size(0, 40, 72) blf.draw(0, "Right") """
2014-11-23Refactor: BLI_path_util (part 2)Campbell Barton
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23Refactor: BLI_path_util (split out app directory access)Campbell Barton
This module is intended for path manipulation functions but had utility functions added to access various directories.
2014-10-08Ghost Context RefactorJason Wilkins
https://developer.blender.org/D643 Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-08-11Fix T40766: Startup fails with UnicodeDecodeError on WindowsCampbell Barton
2014-08-08BGE: move macro body into a function to reduce code-sizeCampbell Barton
2014-07-15BGE: TrackTo actuator: increasing up & track axis optionsJorge Bernal
This is related to Task T34861 to increase up & track axis options for TrackTo actuator. I've just added it to differential to facilitate an easier review. With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis. Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library. The wiki docs are here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator). Test file is here: {F97623} I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator: {F91992} {F91990} Reviewers: moguri, dfelinto Reviewed By: moguri CC: Genome36 Differential Revision: https://developer.blender.org/D565
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-01Python: remove redundant castsCampbell Barton
2014-06-26BGE: New Mouse ActuatorJorge Bernal
Disclaimer: The author of this patch is Geoffrey Gollmer (gomer). I only updated the patch to the current git master status, reworked several parts to fit well with current coding style and applied several fixes. This actuator allows users to show/hide the mouse cursor using logic bricks, as well as control object rotation with a mouse in the BGE. The mouse rotation is flexible enough to allow any type of mouse look, as well as banking for flight controls. {F94520} {F91859} Blend file for testing Mouse actuator (with default parameters and crosshair): {F94920} Reviewers: moguri Reviewed By: moguri CC: gomer, lordodin Differential Revision: https://developer.blender.org/D559
2014-06-17BGE: New Property sensor evaluation typesJorge Bernal
This patch adds "Less Than" and "Greater Than" evaluation types to the property sensor. The Wiki Docs modifications http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Sensors/Property Also, I have attached a screenshot and a blend to check. Reviewers: dfelinto, moguri Reviewed By: moguri Differential Revision: https://developer.blender.org/D476
2014-02-24Partial fix for T3817: BGE crashing when using LibNew.Mitchell Stokes
The BGE needs to use BKE_main_new() isntead of calloc for allocating a Main struct since the threaded depsgraph changes.
2014-02-14Code cleanup: duplicate headersCampbell Barton
2014-01-13Code Cleanup: spellingCampbell Barton
2013-11-04BGE: Cleaning up the BGE's physics code and removing KX_IPhysicsController ↵Mitchell Stokes
and KX_BulletPhysicsController. Instead, we just use PHY_IPhysicsController, which removes a lot of duplicate code. This is a squashed commit of the following: BGE Physics Cleanup: Fix crashes with LibLoading and replication. Also fixing some memory leaks. BGE Physics Cleanup: Removing KX_IPhysicsController and KX_BulletPhysicsController. BGE Physics Cleanup: Moving the replication code outside of KX_BlenderBulletController and switching KX_ConvertPhysicsObjects to create a CcdPhysicsController instead of a KX_BlenderBulletController. BGE Physics Cleanup: Getting rid of an unsued KX_BulletPhysicsController.h include in KX_Scene.cpp. BGE Physics Cleanup: Removing unused KX_IPhysicsController and KX_BulletPhysicsController includes. BGE Physics Cleanup: Removing m_pPhysicsController1 and GetPhysicsController1() from KX_GameObject. BGE Physics Cleanup: Remove SetRigidBody() from KX_IPhysicsController and remove GetName() from CcdPhysicsController. BGE Physics Cleanup: Moving Add/RemoveCompoundChild() from KX_IPhysicsController to PHY_IPhysicsController. BGE Physics Cleanup: Removing GetLocalInertia() from KX_IPhysicsController. BGE Physics Cleanup: Making BlenderBulletCharacterController derive from PHY_ICharacter and removing CharacterWrapper from CcdPhysicsEnvironment.cpp. Also removing the character functions from KX_IPhysicsController. BGE Physics Cleanup: Removing GetOrientation(), SetOrientation(), SetPosition(), SetScaling(), and GetRadius() from KX_IPhysicsController. BGE Physics Cleanup: Removing GetReactionForce() since all implementations returned (0, 0, 0). The Python interface for KX_GameObject still has reaction force code, but it still also returns (0, 0, 0). This can probably be removed as well, but removing it can break scripts, so I'll leave it for now. BGE Physics Cleanup: Removing Get/SetLinVelocityMin() and Get/SetLinVelocityMax() from KX_IPhysicsController. BGE Physics Cleanup: Removing SetMargin(), RelativeTranslate(), and RelativeRotate() from KX_IPhysicsController. BGE Physics Cleanup: Using constant references for function arguments in PHY_IPhysicsController where appropriate. BGE Physics Cleanup: Removing ApplyImpulse() from KX_IPhysicsController. BGE Physics Cleanup: Removing ResolveCombinedVelocities() from KX_IPhysicsController. BGE Physics Cleanup: Accidently removed a return when cleaning up KX_GameObject::PyGetVelocity(). BGE Physics Cleanup: Remove GetLinearVelocity(), GetAngularVelocity() and GetVelocity() from KX_IPhysicsController. The corresponding PHY_IPhysicsController functions now also take Moto types instead of scalars to match the KX_IPhysicsController interface. BGE Physics Cleanup: Moving SuspendDynamics, RestoreDynamics, SetMass, GetMass, and SetTransform from KX_IPhysicsController to PHY_IPhysicsController. BGE Physics Cleanup: PHY_IPhysicsEnvironment and derived classes now use the same naming scheme as PHY_IController. BGE Physics Cleanup: PHY_IMotionState and derived classes now use the same naming convention as PHY_IController. BGE Phsyics Cleanup: Making PHY_IController and its derived classes follow a consistent naming scheme for member functions. They now all start with capital letters (e.g., setWorldOrientation becomes SetWorldOrientation). BGE Physics Cleanup: Getting rid of KX_GameObject::SuspendDynamics() and KX_GameObject::RestoreDynamics(). Instead, use the functions from the physics controller. BGE: Some first steps in trying to cleanup the KX_IPhysicsController mess. KX_GameObject now has a GetPhysicsController() and a GetPhysicsController1(). The former returns a PHY_IPhysicsController* while the latter returns a KX_IPhysicsController. The goal is to get everything using GetPhysicsController() instead of GetPhysicsController1().
2013-11-04BGE Rasterizer Cleanup: Removing the Singletexture material mode. More ↵Mitchell Stokes
conversion code will probably be needed.
2013-08-26BGE: Cleaning up the vsync code a little.Mitchell Stokes
2013-08-20patch [#36503] BGE Python - Radar and Ray sensor wrong AXIS constants wrong ↵Campbell Barton
defined from Jorge Bernal (lordloki)
2013-08-17BGE: Flipping vsync constants so VSYNC_ON is 0.Mitchell Stokes
This will make transitions from older versions of Blender easier since VSYNC_ON will be the default. This could have been changed in a do_version, but the vsync code has yet to see an official release, so I figured this would be a bit nicer. Also, this makes VSYNC_ON the default for new scenes as well.