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
This patch will remove the BlenderWorldInfo and move the source into KX_WorldInfo.
Reviewers: brecht, moguri
Reviewed By: brecht, moguri
Differential Revision: https://developer.blender.org/D156
This patch will fix the color management for the mist and global ambient color.
It will remove the old "Color Management" switch in the BGE "Render > Shading" panel and will use the "Display Device" setting in the "Scene > Color Management" panel instead.
Reviewers: moguri, brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D154
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
This patch will fix the world GLSL (mist, background, ambient) update for the BGE.
Reviewers: moguri, brecht
Reviewed By: moguri, brecht
Subscribers: panzergame
Differential Revision: https://developer.blender.org/D151
This patch fixes the world (mist, background, ambient) F-Curve for for the BGE.
Reviewers: moguri, brecht
Reviewed By: moguri, brecht
Differential Revision: https://developer.blender.org/D150
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
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
This change introduces a new hysteresis parameter that it will be added
or subtracted to/from the LOD distance to avoid popping when a LOD
object moves close to the LOD transition continuously.
Then, we have the following:
- a new LOD Hysteresis setting per scene (default 10%) which is located
in Scene context --> Level of Detail panel. This scene parameter also
will active/deactive the scene hysteresis.
- and a new LOD Hysteresis setting per object (default 10%) which is
located in Object context --> Levels of Detail panel. The LOD hysteresis
setting per object (if active) will overwrite the hysteresis setting per
scene value.
For the new blends: the hysteresis setting per scene would be active by
default and the per object would be inactive by default.
For the old blends: both hysteresis settings (per scene and per object)
would be inactive by default. A quick way to take advantage of this
feature for old blends would be to activate the hysteresis parameter in
the scene context -> Level of Detail panel
Reviewers: campbellbarton, kupoman, moguri
Reviewed By: kupoman, moguri
Subscribers: nonamejuju, lordodin
Differential Revision: https://developer.blender.org/D957
This patch will add a physics constraints replication for group instances
(dupli group).
It also fix crashing when when a group instance is made from a linked
group instance and both are on the active layer.
Initial patch T31443 from moerdn (Martin Sell).
Reviewers: lordloki, sergof, moguri, sybren
Reviewed By: moguri, sybren
Differential Revision: https://developer.blender.org/D658
Two areas of the BGE use a hard-coded 60 Hz as frame rate. However, this 60 Hz is just a default setting, and can be changed in the Blender interface.
This setting is now used instead of the hard-coded 60 Hz.
CcdPhysicsEnvironment::SetFixedTimeStep() is actually never called, as we don't even support a true fixed-timestep simulation.
Added a new "current_lod_level" property to the python api of
KX_GameObject. The property returns the current lod level of the game
object. The purpose of the property is activate logic routines only when
an object is at a certain lod-distance from the camera, avoiding to
separately recomputing the same distance in the logic script. Usage in
python script might look like:
owner = bge.logic.getCurrentController().owner
lod_level = owner.currentLodLevel
if lod_level == 0: ...do something
else: ... object might be too distant
Reviewers: dfelinto, kupoman, moguri
Reviewed By: kupoman, moguri
Subscribers: lordloki
Projects: #game_engine
Differential Revision: https://developer.blender.org/D978
overlay scene
GetGameObjectType is overwritten in KX_FontObject to differentiate a
font object into AddNodeReplicaObject function. Now, in this function,
we add fonts in the appropriate list.
Reviewers: campbellbarton, moguri, dfelinto, lordloki
Reviewed By: lordloki
Subscribers: lordloki
Projects: #game_logic, #game_engine
Differential Revision: https://developer.blender.org/D1130
Blender allows you to create a constraint without specifying its reference
object, even when the constraint requires such a reference. The BGE would
crash on this. This change simply ignores such a constraint.
This patch fix two bugs related to CreateConstraint().
1. Disable linked collision only working with 6DoF constraints.
2. If all pivot axis rotations setted to zero the linked object disappears.
{F101374}
Reviewers: moguri, sybren, brita_, lordloki
Reviewed By: lordloki
Subscribers: p9ablo
Differential Revision: https://developer.blender.org/D704
OpenGL is detected:
Hoping to decrease the frequency of by far one of the most frequent bug
reports by windows users.
There is some reorganization of the GHOST API to allow easy addition of
further OpenGL options in the future. The change is not propagated too
deep to keep the size of the patch managable. We might reorganize things
here later.
For OpenGL we do two checks here:
One is a combination of GDI generic renderer or vendor microsoft
corporation and OpenGL version 1.1. This means the system does not
use GPU acceleration at all. We warn user to install a graphics
driver and of cases where this might happen (remote connection, using
blender through virtual machine)
The other one just checks if OpenGL version is less than 1.4 (we can
easily change that in the future of course) and warns that it is
deprecated.
Both cases will still let blender startup correctly but users should now
have a clear idea of the system being unsupported.
A user preference flag is provided to turn the warning off.
Now stop posting those bug reports without installing a driver first -
please?
Deleting an object was deleting all rigidbody constraints in the scene.
Bug was introduced with D701.
Reviewers: agoose77, sergof, moguri, lordloki, sybren
Reviewed By: lordloki, sybren
Subscribers: sybren, hbar, blueprintrandom, sergof, agoose77
Differential Revision: https://developer.blender.org/D1007
New Lock Z velocity parameter was added. This parameter avoid the micro-jumping.
By default it is actived except when you load an old file that it is deactived to keep former behaviour.
Additionally it was solved another issue related with the acceleration: That is the acceleration value was not taked into account and we had always the maximum linear velocity from the beginning of movement. Now the acceleration is taken into account until we reach the maximum velocity.
When you load an old file, the acceleration value is set to the maximum range (1000.f). This way we simulate a maximum velocity constant from the beginning of movement (former behaviour).
{F142195}
Reviewers: moguri, dfelinto, campbellbarton
Reviewed By: campbellbarton
Subscribers: sergey
Differential Revision: https://developer.blender.org/D1074
Null check to verify that parent has a character controller. Otherwise (i.e empty) it will crash.
Reviewers: moguri, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1115
Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits.
Other systems also modified to put them inline with this solution.
Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton
Reviewed By: juicyfruit, campbellbarton
Subscribers: juicyfruit
Differential Revision: https://developer.blender.org/D1122
Due to changes in the way animation updates were handled,
BL_ArmatureObjects were no longer registering to KX_Scene as animated.
Moguri says: It might have been relying on the deformer update which
moved rom being called on every object in the render step. Now
armature deformers are only updated if they need to be.
Fix T42919 & Fix T42218
We make sure that good values are passed to GetPolygon() and we check that the visual mesh doesn't have a wrong displacement when it passes over a object which has a mesh triangle as compound bound.
Reviewers: dfelinto, sergof, agoose77, moguri
Reviewed By: moguri
Subscribers: agoose77
Differential Revision: https://developer.blender.org/D979
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
This patch adds two parameters to the functions in the
collisionCallbacks list. The callback function should thus be like
this:
```
def on_colliding(other, point, normal):
print("Colliding with %s at %s with normal %s" % (other, point, normal))
game_ob.collisionCallbacks.append(on_colliding)
```
The `point` parameter will contain the collision point in world
coordinates on the current object, and the `normal` contains the
surface normal at the collision point.
The callback functions are checked for the number of arguments
`co_argcount`. The new `point` and `normal` arguments are only passed
when `co_argcount > 1` or when `co_argcount` cannot be determined.
Reviewers: brita_, campbellbarton
Subscribers: sergey, sybren, agoose77
Projects: #game_physics
Differential Revision: https://developer.blender.org/D926
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
-Removing unused parameters
-Updating some parts to match bpy_interface.c initialization
Cherry-picking 14fceb6 onto 117edbb
Conflicts:
source/gameengine/Ketsji/KX_PythonInit.cpp
Red was used with different semantics in the physics visualisation,
switching to yellow to prevent confusion.
A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's
the yellow balls + lines.
Reviewers: brita_, lordloki, campbellbarton
Reviewed By: lordloki, campbellbarton
Subscribers: lordloki
Projects: #game_physics
Differential Revision: https://developer.blender.org/D925
A screenshot can be found at http://www.pasteall.org/pic/80766 -- it's the yellow balls + lines.
Reviewers: brita_, lordloki, campbellbarton
Reviewed By: lordloki, campbellbarton
Subscribers: lordloki
Projects: #game_physics
Differential Revision: https://developer.blender.org/D925
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")
"""
Refactored some code to be easier to read. Semantically the code is
identical.
- Some conditions were negated to be able to return/continue early,
rather than having the majority of the code inside an if-body.
- Conditions were simplified (!(a == b)) turned into (a != b);
repeated conditions calculated only once.
- Unnecessary variables and one unnecessary condition were
eliminated.
Reviewers: campbellbarton, lordloki
Reviewed By: lordloki
Projects: #game_physics
Differential Revision: https://developer.blender.org/D954
This patch adds the following R/W properties and method to `KX_GameObject`:
- `linearDamping` -- get/set linear damping
- `angluarDamping` -- get/set angular damping
- `setDamping(linear, angular)` -- set both simultaneously
These allow runtime changes to the same properties that are accessible at design time in Blender's UI via `game.damping` and `game.rotation_damping`. The names of the properties were chosen to mirror the internal names of the BGE physics engine, as these are (AFAIK) also the commonly used names in physics literature.
Reviewers: campbellbarton
Projects: #game_physics
Differential Revision: https://developer.blender.org/D936
`INSERT_FAST` implies you call `calchandles_fcurve()` at the end...
For now, since we do not store edited FCurves nor can we get them easily
(requires RNA...), just update handles of all fcurves, it's much more
performant than removing usage of `INSERT_FAST` anyway.
Instead of getting fancy this time, we'll just use Mahalin's simpler
fix. This may have slight performance impacts, but it is a lot simpler
than the previous fix and shouldn't cause as many bugs.
With this fix the mouse actuator movement works well as with even screen resolutions as odd screen resolutions.
Also it fixed the movement when the border of the blenderplayer window is out of the screen limits.
Reviewed By: moguri
Differential Revision: https://developer.blender.org/D946
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.
also fixes unlikely memory leak if the data-array can't be allocated.
ImageFFmpeg objects will not refresh properly because the image
file is closed immediately after creation. Therefore refresh()
should have no effect on them.
This was causing problems with ImageMix using ImageFFmpeg as
sources: refreshing the ImageMix object is required to update
the mix but it has the side effect of refreshing the underlying
sources, hence the need to skip refresh on fixed images.
Fix for T41294.
Rigid body constraints are not deleted, if the corresponding game objects are deleted.
Reviewers: moguri
Differential Revision: https://developer.blender.org/D701
after the completion of the action in "Flipper", layer is removed and the actuator mistakenly receive zero when trying to get the current frame
Patch Author: avrprj
Reviewers: moguri
Projects: #game_logic
Differential Revision: https://developer.blender.org/D906
This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.
We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D878
Navigation mesh object need to access the current scene at
creation time. This can be at scene start or when an object
is instantiated from an inactive layer. The method of getting
the scene differs in these cases. This fix handles both.