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-07-31simplify redundant conditionalsMike Erwin
The redundant terms were harmless but check an expression we already know to be true (from earlier in the same conditional). Found by PVS-Studio T48917
2016-07-18fix breakage caused by D2094 / rB404f41d22de46119ee8afb409011eb1ba1840092lazydodo
2016-07-14PyAPI: fix memory leaks in dictionary assignmentCampbell Barton
Thanks to Kévin Dietrich for spotting driver leak, checked other uses of PyDict_SetItem and found more.
2016-07-10Cleanup/Refactor: pass Main pointer to all ID copy functions.Bastien Montagne
Also allows us to get rid of a few _copy_ex() versions...
2016-07-09Cleanup to shapekeys' make_local (and copy) functions.Bastien Montagne
Mostly pass bmain and do not check for NULL key, keys' make_local is suspiciously simple in fact, but think until those behave like real full-featured IDs, it's doing enough!
2016-07-02Cleanup: comment blocksCampbell Barton
2016-07-01BGE: Display Hardware infos only in standalone.Ulysse Martin
This patch moves the PrintHardwareInfo() function in standalone only, not in embedded. Why? Because you can need this infos for debugging purpose in "compiled" blender files but it was boring to have it displayed each time you launched embedded. So you can have this infos when you click standalone or when you run your executable app from a console. Reviewers: moguri, kupoman, panzergame.
2016-06-22ID-Remap - Step one: core work (cleanup and rework of generic ID datablock ↵Bastien Montagne
handling). This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock was pretty much impossible, except for a few special cases. Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite a few ID usages were missed or wrongly handled that way). One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling by using library_query utils to allow generic handling of those, which is now the case (now, generic ID links handling is only "knwon" from readfile.c and library_query.c). This commit also adds backends to allow live replacement and deletion of datablocks in Blender (so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one, or NULL one in case of unlinking). This will allow nice new features, like ability to easily reload or relocate libraries, real immediate deletion of datablocks in blender, replacement of one datablock by another, etc. Some of those are for next commits. A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core. Though it was tested rather deeply, being totally impossible to check all possible ID usage cases, it's likely there are some remaining issues and bugs in new code... Please report them! ;) Review task: D2027 (https://developer.blender.org/D2027). Reviewed by campbellbarton, thanks a bunch.
2016-06-18Cleanup: style, whitespace, doxy filepathsCampbell Barton
2016-06-11BGE: DeckLink card support for video capture and streaming.Benoit Bolsee
You can capture and stream video in the BGE using the DeckLink video cards from Black Magic Design. You need a card and Desktop Video software version 10.4 or above to use these features in the BGE. Many thanks to Nuno Estanquiero who tested the patch extensively on a variety of Decklink products, it wouldn't have been possible without his help. You can find a brief summary of the decklink features here: https://wiki.blender.org/index.php/Dev:Source/GameEngine/Decklink The full API details and samples are in the Python API documentation. bge.texture.VideoDeckLink(format, capture=0): Use this object to capture a video stream. the format argument describes the video and pixel formats and the capture argument the card number. This object can be used as a source for bge.texture.Texture so that the frame is sent to the GPU, or by itself using the new refresh method to get the video frame in a buffer. The frames are usually not in RGB but in YUV format (8bit or 10bit); they require a shader to extract the RGB components in the GPU. Details and sample shaders in the documentation. 3D video capture is supported: the frames are double height with left and right eyes in top-bottom order. The 'eye' uniform (see setUniformEyef) can be used to sample the 3D frame when the BGE is also in stereo mode. This allows to composite a 3D video stream with a 3D scene and render it in stereo. In Windows, and if you have a nVidia Quadro GPU, you can benefit of an additional performance boost by using 'GPUDirect': a method to send a video frame to the GPU without going through the OGL driver. The 'pinned memory' OGL extension is also supported (only on high-end AMD GPU) with the same effect. bge.texture.DeckLink(cardIdx=0, format=""): Use this object to send video frame to a DeckLink card. Only the immediate mode is supported, the scheduled mode is not implemented. This object is similar to bge.texture.Texture: you need to attach a image source and call refresh() to compute and send the frame to the card. This object is best suited for video keying: a video stream (not captured) flows through the card and the frame you send to the card are displayed above it (the card does the compositing automatically based on the alpha channel). At the time of this commit, 3D video keying is supported in the BGE but not in the DeckLink card due to a color space issue.
2016-06-11BL_Shader.setUniformEyef(name)Benoit Bolsee
defines a uniform that reflects the eye being rendered in stereo mode: 0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures containing the left and right eye images in a top-bottom order. python: shader = obj.meshes[0].materials[mat].getShader() shader.setUniformEyef("eye") shader: uniform float eye; uniform sampler2D tex; void main(void) { vec4 color; float ty, tx; tx = gl_TexCoord[0].x; ty = eye+gl_TexCoord[0].y*0.5; // ty will be between 0 and 0.5 for the left eye render // and 0.5 and 1.0 for the right eye render. color = texture(tex, vec2(tx, ty)); ... }
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-06-09BGE: alpha on frame buffer and precedence of MSAA over swap.Benoit Bolsee
A new option '-a' can be passed to the blenderplayer. It forces the framebuffer to have an alpha channel. This can be used in VideoTexture to return a image with alpha channel with ImageViewport (provided alpha is set to True on the ImageViewport object and that the background color alpha channel is 0, which is the default). Without the -a option, the frame buffer has no alpha channel and ImageViewport always returns an opaque image, no matter what. In Linux, the player window will be rendered transparently over the desktop. In Windows, the player window is still rendered opaque because transparency of the window is only possible using the 'compositing' functions of Windows. The code is there but not enabled (look for WIN32_COMPOSITING) because 1) it doesn't work so well 2) it requires a DLL that is only available on Vista and up. give precedence to AA over Swap copy: Certain GPU (intel) will not allow MSAA together with swap copy. Previously, swap copy had priority over MSAA: fewer AA samples would be chosen if it was the condition to get swap copy. This patch reverse the logic: swap copy will be abandonned if another swap method (undefined or exchange) will provide the number of AA samples requested. If no AA samples is requested, swap copy still has the priority of course.
2016-05-12Fix missing piece in recent rBce65fae8f32c (support for '+' key).Bastien Montagne
Thanks to Daniel Rivera (Dr2d4) for the headup!
2016-05-10Attempt to fix blenplayer after recent changesSergey Sharybin
2016-05-10Fix T48393: Blender player doesn't start on files saved with with cyrillic ↵Sergey Sharybin
letters in path
2016-05-10Fix T48369: Missing suport for main '+' key.Bastien Montagne
Many keyboard layouts (italian, spanish, german...) have direct access to '+' key on main keyboard area (not the numpad one), ans x11 has own define for this key, so use it instead of generating an unkown key event. Note that we most likely have much more missing 'specific' keycodes for non-US keyboard layout, but think since we already had a 'minus' keyevent, supporting 'plus' one is totally consistent. And we had a spare space in our defined values just for it even! This keyevent is only supported/generated by x11 and cocoa Ghost backends for now, neither SDL nor win32 seem to have matching key events...
2016-04-26Support multiple tangents for BI render & viewportAlexander Romanov
Normal Map node support for GLSL mode and the internal render (multiple tangents support). The Normal Map node is a useful node which is present in the Cycles render. It makes it possible to use normal mapping without additional material node in a node tree. This patch implements Normal Map node for GLSL mode and the internal render. Previously only the active UV layer was used to calculate tangents.
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).
2016-04-11BGE: Fix T48071: Global logic managerPorteries Tristan
Previously the logic manager was used as a global variable for SCA_ILogicBrick::m_sCurrentLogicManager, this request to always update it before run any python script and allow call function like ConvertPythonTo[GameObject/Mesh]. The bug showed in T48071 is that as exepted the global m_sCurrentLogicManager is not updated with the proper scene logic manager. Instead of trying to fix it by updating the logic manager everywhere and wait next bug report to add a similar line. The following patch propose a different way: - Every logic brick now contain its logic manager to SCA_ILogicBrick::m_logicManager, this value is set and get by SCA_ILogicBrick::[Set/Get]LogicManager, It's initialized from blender conversion and scene merging. - Function ConvertPythonTo[GameObject/mesh] now take as first argument the logic manager to find name coresponding object or mesh. Only ConvertPythonToCamera doesn't do that because it uses the KX_Scene::FindCamera function. Reviewers: moguri Differential Revision: https://developer.blender.org/D1913
2016-03-23Fix T47893: BGE crashes w/ generated mesh dataCampbell Barton
2016-03-13More compile fixes - Game EngineJoshua Leung
2016-03-13Full Inverse-Quadratic-Equation Lamp FalloffJack Andersen
This patch adds a new `falloff_type` ('Inverse Coefficients') for Lamps in Blender-Internal and GLSL. The current falloff modes use a formula like this inverse-square one: `I = E × (D^2 / (D^2 + Q × r^2))` While such a formula is simple for 3D-artists to use, it's algebraically cumbersome to work with. Game-designers authoring their own shaders could benefit much more by having direct control of falloff-coefficients: `I = E × (1.0 / (coefC + coefL × r + coefQ × r^2))` In this mode, the `distance` parameter is unused (except for 'Sphere' mode); instead relying on the designer to mathematically-model the falloff-behavior. The UI has been patched like so: {F153843} Reviewers: brecht, psy-fi Reviewed By: psy-fi Subscribers: brita_, antidote, campbellbarton, psy-fi Differential Revision: https://developer.blender.org/D1194
2016-03-11BGE: Fix memory leak in VBO codeMitchell Stokes
2016-03-11BGE: Fix animations when using VBOsMitchell Stokes
2016-03-01UPBGE: Fix light visibilityUlysse Martin
2016-03-01UPBGE: Disallow shadow buffer render when the lamp is hidden.Porteries Tristan
It now allow the user to use multiple shadow lamps and hidden the culled lamps.
2016-02-26Fix T47015: BGE, objects vanish aligning to vectorCampbell Barton
1811 by @mangostaniko Fixes regression since moving to floats.
2016-02-23Fix warnings reported by MSVCSergey Sharybin
Mainly it's related on a bad practice in SDL to force-define __SSE__ and __SSE2__ flags which generates quite some warnings and causes too much noise. There are some other warnings fixed. Should be no functional changes. NeXyon, please check the changes in audaspace :)
2016-02-20Make Blender ready for C++11Sergey Sharybin
Did a full compile of debug build with C++11 enabled, it all passed compilation apart from some deprecated type used in GE's Video Texture. Solved it inside of ifdef block now. In the future we should uncomment the MSVC part of it, it should all be safe and correct (MSVC2013 does not define new C++ version but supports C++11). The reason it is commented is to have absolutely no effect on the upcoming release.
2016-02-18BGE: Allow access to original texture openGL Bind code/Id/NumberUlysse Martin
This patch adds a python method to get openGL bind code of material's texture according to the texture slot. Example: import bge cont = bge.logic.getCurrentController() own = cont.owner bindId = own.meshes[0].materials[0].getTextureBindcode(0) Test file: http://www.pasteall.org/blend/40679 This can be used to play with texture in openGL, for example, remove mipmap on the texture or play with all wrapping or filtering options. And this can be used to learn openGL with Blender. Reviewers: TwisterGE, kupoman, moguri, panzergame Reviewed By: TwisterGE, kupoman, moguri, panzergame Projects: #game_engine Differential Revision: https://developer.blender.org/D1804
2016-02-16Make game engine ready for FFmpeg-3.0 as wellSergey Sharybin
2016-02-15Cleanup: reorganize BKE ID tagging functions.Bastien Montagne
BKE_main_id_tag_/BKE_main_id_flag_ were horrible naming now that we split those into flags (for presistent one) and tags (for runtime ones). Got rid of previous 'tag_' functions behavior (those who were dedicated shortcuts to set/clear LIB_TAG_DOIT), so now '_tag_' functions affect tags, and '_flag_' functions affect flags.
2016-01-28cleanup: spelling, comments, alignmentMike Erwin
fixed pet peeve “frustrum” and other non-functional changes.
2016-01-27World textures displaying for viewport in BI.Alexander Romanov
This patch supports "Image or Movie" and "Environment map" types of world texture for the viewport. It supports: - "View", "AngMap" and "Equirectangular" types of mapping. - Different types of texture blending (according to BI world render). - Same color blending as when it lacked textures (but render via glsl). {F207734} {F207735} Example: {F275180} Original author: @valentin_b4w Regards, Alexander (Blend4Web Team). Reviewers: sergey, valentin_b4w, brecht, merwin Reviewed By: merwin Subscribers: campbellbarton, merwin, blueprintrandom, youle, a.romanov, yurikovelenov, AlexKowel, Evgeny_Rodygin Projects: #rendering, #opengl_gfx, #bf_blender:_next Differential Revision: https://developer.blender.org/D1414
2016-01-25Fix T46902: Revert zeroing velocity in BGE logic brickSybren A. Stüvel
This reverts commit 3dbc123061aa063efd1fca358f5e295b0ce7b302, "BGE: allow setting velocity to zero in a motion actuator" as it caused more issues than it solved. Zeroing linear or angular velocity with logic bricks is discussed further in https://developer.blender.org/D1545
2016-01-23Vector Transform node support for GLSL mode and the internal rendererAlexander Romanov
The Vector Transform node is a useful node which is present in the Cycles renderer. {F144283} This patch implements the Vector Transform node for GLSL mode and the internal renderer. Example: {F273060} Alexander (Blend4Web Team) Reviewers: brecht, campbellbarton, sergey Reviewed By: campbellbarton, sergey Subscribers: psy-fi, duarteframos, RobM, lightbwk, sergey, AlexKowel, valentin_b4w, Evgeny_Rodygin, yurikovelenov Projects: #bf_blender:_next Differential Revision: https://developer.blender.org/D909
2016-01-17BGE: Allow access to light shadow settings with pythonUlysse Martin
This patch adds a new API which allow us to access light shadow settings from python. The new API can be used to write custom GLSL materials with shadows. Reviewers: brecht, kupoman, agoose77, panzergame, campbellbarton, moguri, hg1 Reviewed By: agoose77, panzergame, campbellbarton, moguri, hg1 Projects: #game_engine Differential Revision: https://developer.blender.org/D1690
2016-01-04Remove SCons building systemSergey Sharybin
While SCons building system was serving us really good for ages it's no longer having much attention by the developers and started to become quite a difficult task to maintain. What's even worse -- there started to be quite serious divergence between SCons and CMake which was only accumulating over the releases now. The fact that none of the active developers are really using SCons and that our main studio is also using CMake spotting bugs in the SCons builds became quite a difficult task and we aren't always spotting them in time. Meanwhile CMake became really mature building system which is available on every platform we support and arguably it's also easier and more robust to use. This commit includes: - Removal of actual SCons building system - Removal of SCons git submodule - Removal of documentation which is stored in the sources and covers SCons - Tweaks to the buildbot master to stop using SCons submodule (this change requires deploying to the server) - Tweaks to the install dependencies script to skip installing or mentioning SCons building system - Tweaks to various helper scripts to avoid mention of SCons folders/files as well Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit Reviewed By: campbellbarton, juicyfruit Differential Revision: https://developer.blender.org/D1680
2016-01-03Get rid of three needless instances of DM_DRAW_OPTION_NO_MCOL.Antony Riakiotakis
It would be good to get rid of this entirely, ideally decision about mcols can be taken at material level and not done per face. More work needs to be done for that to work though.
2015-12-30BGE: Fix invalid operator< for microsoft compiler.Porteries Tristan
It fixes the strict weak ordering assertion failure, see : https://support.microsoft.com/en-us/kb/949171. sybren and youle are the author of this commit.
2015-12-27Split id->flag in two, persistent flags and runtime tags.Bastien Montagne
This is purely internal sanitizing/cleanup, no change in behavior is expected at all. This change was also needed because we were getting short on ID flags, and future enhancement of 'user_one' ID behavior requires two new ones. id->flag remains for persistent data (fakeuser only, so far!), this also allows us 100% backward & forward compatibility. New id->tag is used for most flags. Though written in .blend files, its content is cleared at read time. Note that .blend file version was bumped, so that we can clear runtimeflags from old .blends, important in case we add new persistent flags in future. Also, behavior of tags (either status ones, or whether they need to be cleared before/after use) has been added as comments to their declaration. Reviewers: sergey, campbellbarton Differential Revision: https://developer.blender.org/D1683
2015-12-27OpenGL: stipple support added to basic GLSL shaderAlexander Romanov
The is intended to replace the deprecated glPolygonStipple() calls with a shader based alternative, once we switch over to GLSL shaders. Reviewers: brecht Differential Revision: https://developer.blender.org/D1688
2015-12-17Fix T46959: sys.meta_path reset on on exitCampbell Barton
2015-12-17Cleanup: quiet warningCampbell Barton
2015-12-16BGE clean up: use float version of trigonometric functionsJorge Bernal
2015-12-16BGE Ketsji clean-up: double-promotion warningsJorge Bernal
2015-12-15use float (not double) for font matrixMike Erwin
Following up on recent double --> float commits in the game engine.
2015-12-14BGE Physics clean up: double-promotion warningsJorge Bernal
2015-12-14BGE Scenegraph clean up: double-promotion warningsJorge Bernal