Commit Graph

2969 Commits

Author SHA1 Message Date
Mitchell Stokes
d5588fd658 Fix T40113: Skinned meshes with non-animated shape keys crashes the BGE. 2014-05-09 16:05:23 -07:00
Mitchell Stokes
087bbe624f BGE: Fixing shape key animations on meshes with no armature.
Their transverts were not being updated after code changes for
multi-threaded skinning.
2014-05-09 16:03:54 -07:00
Mitchell Stokes
ff08acc556 BGE VideoTexture: Fix for loading PNG (and possibly other) files. 2014-05-09 13:53:42 -07:00
Campbell Barton
88e5705a3f Code Cleanup: remove unused m_contactProcessingThreshold 2014-05-08 14:22:47 +10:00
Mitchell Stokes
ee5284faf6 BGE: Dynamically-allocated action layers
This patch removes the limitations on the number of action layers in the BGE.

BL_ActionManager currently uses a fixed array to keep track of the action layers. This patch replaces the fixed array with a map which allows for dynamic allocation of action layers. Layers (map items) are automatically removed on BL_ActionManager's update function. The maximum number of layers is roughly the value of a short. Backwards functionality is maintained and there are no changes to the Python API.

Task Discussion:
https://developer.blender.org/T39572

Author: Kevin Ednalino

Reviewers: moguri

Differential Revision: https://developer.blender.org/D491
2014-05-07 20:32:50 -07:00
Mitchell Stokes
362b25b382 Fix T39928: Blender crash/freeze when game engine is started with animation played directly on camera object with parents.
Updating object IPOs is not currently thread-safe since it also updates
children. This leads to problems when parents and children are both
animated. For now, updating object IPOs is done in its own loop to avoid
threading issues.
2014-05-04 15:39:15 -07:00
Mitchell Stokes
1a8b17661f Fix T35552: LibLoading objects with Collision sensors gives an error
The collision sensors were not being properly unregistered from the
physics system before they were merged into the current scene.
2014-05-02 00:08:00 -07:00
Mitchell Stokes
27cbb28659 BGE cleanup: Removing the unused SCA_EventManager::Replace_PhysicsScene(). 2014-05-01 19:43:07 -07:00
Mitchell Stokes
685316b406 BGE: Forgot a NULL check in CcdPhysicsEnvironment::MergeEnvironment() 2014-05-01 18:34:25 -07:00
Mitchell Stokes
9f16428cb5 BGE cleanup: Moving the PHY_* includes in BL_BlenderDataConversion.cpp
These includes are now with the rest of the includes instead of in the
middle of the file. This should also help building on OS X.
2014-05-01 15:26:05 -07:00
Mitchell Stokes
5f80a7ffe2 Fix T39932: LibNew can't find LibLoaded meshes.
LibNew now searchs dynamic (i.e., LibLoaded)  mains instead of just the current main.
2014-05-01 14:49:42 -07:00
Mitchell Stokes
60c8c130fe BGE cleanup: KX_GameObject::GetParent() no longer increases the object's refcount.
I'm not sure why this function ever increased the object's refcount. Any
place in the code that calls KX_GameObject::GetParent() has to turn
around and call parent->Release(). Forgetting to call Release() was a
common cause of memory leaks (in fact, KX_SteeringActuator was probably
leaking). If the refcount needs to be increased, the calling code can
handle calling AddRef().
2014-04-30 18:53:32 -07:00
Antony Riakiotakis
6ab3a2f8a4 Change naming slightly, it conflicts with DrawText function define on
windows on MinGW
2014-04-30 11:57:12 +03:00
Mitchell Stokes
cdc5d6537f BGE: Fixing a memory leak from the recent physics changes. 2014-04-29 23:53:19 -07:00
Mitchell Stokes
d8282da545 Correction to last commit 2014-04-28 16:33:26 -07:00
Mitchell Stokes
3448822b2f Fix T39614: Ping Pong Action doesn't work correctly 2014-04-28 16:24:40 -07:00
Sergey Sharybin
5bcc9ee4fe COmpilation error fix after recent cleanup in BGE 2014-04-24 13:03:41 +06:00
Mitchell Stokes
f5c3c624f8 BGE Cleanup: Moving reinstancing physics shapes from KX_ConvertPhysicsObject to PHY_IPhysicsController
This was the last item in KX_ConvertPhysicsObject. Therefore,
KX_ConvertPhysicsObject.h and KX_ConvertPhysicsObjects.cpp have been
removed.
2014-04-23 19:39:57 -07:00
Mitchell Stokes
8cee587bcb BGE Cleanup: Physics conversion is now handled by PHY_IPhysicsEnvironment
The current physics conversion code was moved from
KX_ConvertPhysicsObjects to CcdPhysicsEnvironment.
2014-04-23 18:39:33 -07:00
Mitchell Stokes
89c61b20f0 BGE Cleanup: Reducing KX_BlenderSceneConverter's dependence on Bullet.
* Moving the BlenderDebugDraw (derived from btIDebugDraw) from
    KX_BlenderSceneConverter to CcdPhysicsEnvironment
  * Moving CcdPhysicsEnvironment initialization to CcdPhysicsEnvironment
    (this could probably be cleaned up some more with some sort of
    factory, or at least moving code to CcdPhysicsEnvironment's
    constructor)
  * Simplifying physics environment initialization (went from two
    switches to one)
2014-04-23 17:53:25 -07:00
Mitchell Stokes
3442a658fc BGE Cleanup: Reducing KX_Scene's dependence on Bullet.
Instead, it now relies more on our physics abstractions (e.g.,
PHY_IPhysicsEnvironment).
2014-04-23 14:08:49 -07:00
Mitchell Stokes
81e28b8802 BGE Cleanup: Removing the empty KX_ClearBulletSharedShapes() function 2014-04-23 13:59:04 -07:00
IRIE Shinsuke
fc28732ba6 Blender Internal: Add material property "Cast" which can disable both ray and buffer shadows.
Also refactor:
- Material property UI related to shadows
- Preparation of OR-ed mode flags (ma->mode_l) of render materials

Reviewers: brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D313
2014-04-23 15:03:34 +09:00
Mitchell Stokes
4609593a17 BGE Cleanup: Removing all of the my_* functions in KX_ConvertPhysicsObjects.cpp that were used to get bounds information
Now we just use BKE_object_boundbox_get().
2014-04-22 20:36:36 -07:00
Mitchell Stokes
df1a199787 BGE Cleanup: Removing KX_ObjectProperties, KX_BoundBoxClass, KX_BoxBounds, and KX_CBounds
These were used in BL_CreatePhysicsObjectNew() in the converter. However, all
of the data put into KX_ObjectProperties was then copied again in
KX_ConvertBulletObject(). So, instead KX_ConvertBulletObject() now gathers the
information it needs itself, which avoid this odd double conversion step for
physics.

As a side-effect, the old code would result in static non-mesh objects with no bounds
set to still have triangle mesh bounds. This would result in no bounds for these objects.
If a bounds was set that required a mesh, non-mesh objects would become sphere bounds.
This is now true regardless of whether user bounds were set. In other words, static
non-mesh objects now use sphere bounds by default instead of mesh bounds. This might
slightly alter some games, but these objects should generally be set to No Collision
anyways.
2014-04-22 20:12:22 -07:00
Mitchell Stokes
0f91d2cec9 Fix T39458: Switching physics type from Character to Dynamic enables ghost flag silently
Enabling ghost for Sensors and Characters is now done in conversion
rather than when setting the RNA.
2014-04-22 16:42:03 -07:00
Mitchell Stokes
b4cb467359 BGE: Fixing memory leaks when deactivating Sensors, Controllers, or actuators.
Found by Coverity and confirmed with Valgrind.
2014-04-19 14:51:29 -07:00
Jorge Bernal
a5b9f22454 BGE - button for deactivate sensors, controllers and actuators
This change introduces a new checkbox to deactivate the sensors, controllers and/or actuators. It is useful during the development phase to avoid delete sensors, controllers or actuators if you want to test something new.

NOC: The wiki page is being updated (the images mostly), but the feature is already in the 2.71 release log.

{F61628}

Reviewers: moguri, dfelinto, campbellbarton, dingto, #user_interface, billrey

Reviewed By: moguri

CC: billrey

Differential Revision: https://developer.blender.org/D16
2014-04-16 22:40:07 -03:00
Mitchell Stokes
d050577176 Fix T39445: Async LibLoad Crash
There was some deadlock due to trying manage Python's GIL. Instead of
continuing to fight with it, anything needing to call into Python while
conversion during lib loading is just delayed until it can be done in
the main thread.
2014-04-16 01:15:40 -07:00
Daniel Stokes
70f089b6f5 Fix T39509: Crash when assign an empty as a LoD
Missing check when looking for appropriate LoD
2014-04-15 20:06:56 +00:00
Thomas Dinges
f7d06cdb6b Code cleanup: RAS_ILightObject is class, not a struct.
Patch by John Pavel.
Differential Revision: https://developer.blender.org/D459
2014-04-12 20:12:07 +02:00
Campbell Barton
3216e4b202 API Cleanup: Use BKE_constraint prefix for constraint api 2014-04-11 11:47:07 +10:00
Mitchell Stokes
1ce726adb9 BGE: Allow skinned meshes with modifiers to do skinning updates in parallel. 2014-04-09 17:04:17 -07:00
Mitchell Stokes
19413644da BGE: Fixing a crash when animating objects with modifiers and armatures.
Our deformer system really needs some work. First, there was a crash
with shape keys because BL_ModifierDeformer derives from
BL_ShapeDeformer, which means we try to execute shape keys even if we do
not have them. Also, for some reason BL_ModifierDeformer::Update() does
not work if called from the threaded loop, so it is skipped for now. In
other words, skinned updates on meshes with modifiers are currently not
run in parallel.
2014-04-09 16:22:55 -07:00
Mitchell Stokes
fe05f97841 BGE: Multi-threading animation updates and skinning.
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-04-06 16:30:59 -07:00
brita
1194037327 blenderplayer - Reviewed some command line options and the respective help
Doubts: are written as comments in the code
Current Problems:
 - stereo modes sometimes have different names and are ordered differently everywhere (blender properties panel names and tooltips, blenderplayer cmndline)
 - dome mode as several options, but can only take one at a time, like -D mode bla -D tilt X -D ...
 - gameoptions are also given one at a time, like above, but with an assignment -g option = X  . This is inconsistent.
 - gameoptions need to be reviewed and docummented
 - parent to window (-i) is useful for what? (there is no wiki on this either)
 - there is no support for verbose options like --help (blender itself supports it)

Reviewers: dfelinto, moguri

CC:

Differential Revision: https://developer.blender.org/D312
2014-04-06 14:38:15 -07:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Campbell Barton
482201d1a0 Style cleanup 2014-03-31 05:46:19 +11:00
Mitchell Stokes
93c896d53b BGE code cleanup: Removing an unused include in KX_Light.cpp 2014-03-27 22:44:30 -07:00
Mitchell Stokes
df9d6737b9 BGE code cleanup: Removing OpenGL and bf_gpu code from KX_LightObject
The ultimate goal is to only allow the rasterizer to handle OpenGL and bf_gpu
calls. This commit creates a RAS_ILightObject interface and a RAS_OpenGLLight
implementation.
2014-03-27 22:32:06 -07:00
Mitchell Stokes
7ff123ce5c Fix T39452: Meshes without materials causes a memory leak in the game engine
These types of meshes do not use material caching, and thus only the first created
material would be saved, but subsequent ones were not. Those subsequent materials
were then not being freed. Now we make sure to track all of the materials.

Note: Meshes that cannot make use of material caching (no materials or using face textures)
can still use up a large amount of RAM since a material is created per face.
2014-03-27 13:51:07 -07:00
Mitchell Stokes
9d244e0ad7 Code cleanup: Removing KX_KetsjiEngine::m_drawingmode
The rasterizer is already handling this, and there is
no need to duplicate the data.
2014-03-24 20:11:11 -07:00
Mitchell Stokes
b66a9543bb Fix T38929: BGE: Strange behaving from addObject after trying to add an nonexisting overlay scene
If bge.logic.addScene() could not find the scene to add it would add the
first scene again, which is just silly. Now, if no scene is found, a warning
is printed and nothing is added.
2014-03-24 17:57:02 -07:00
Sergey Sharybin
92a539ec92 Fix T38051: Even if Color Management is disabled, it is still applied to the background 2014-03-21 14:06:44 +06:00
Mitchell Stokes
e02b9c8a45 BGE: Adding support for the Cast Only material option.
Note: This does not add support for the option in the viewport.
2014-03-19 23:57:49 -07:00
Mitchell Stokes
eedde311bb Fix T36566: 2D filters broken in the Blenderplayer when using side by side stereo
GPC_Canvas::GetWindowArea() and KX_BlenderCanvas::GetWindowArea() are tracking two
different things. The 2d filter system doesn't actually need the window area and
can get by just using the viewport dimensions, which it now does. The GetWindowArea()
mess should probably be cleaned up.
2014-03-19 23:02:11 -07:00
Campbell Barton
2097e621ed Code cleanup: use r_ prefix for return args 2014-03-16 03:26:23 +11:00
Mitchell Stokes
411650f2fa Partial fix for T3817: BGE crashing when using LibNew.
The BGE needs to use BKE_main_new() isntead of calloc for
allocating a Main struct since the threaded depsgraph changes.
2014-02-23 12:44:33 -08:00
brita
9753641c5d Fix T38645 - Mouse reversed in standalone player with kde
Reviewers: moguri

Differential Revision: https://developer.blender.org/D344
2014-02-22 17:23:18 -08:00
Campbell Barton
3a44e975a9 Fix T38539: Can't set near sensor distance above 100 via python 2014-02-22 13:57:12 +11:00