Commit Graph

2959 Commits

Author SHA1 Message Date
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
Mitchell Stokes
16c75cf594 Fix T38654: Using a non-camera object for the SetCamera Scene Actuator causes a segfault.
Non-camera objects are not supported as cameras, and trying to use them
just causes memory errors (some bad typecasts are involved). When converting
a Scene Actuator, only use the object as a camera if it is actually a camera.
Also, the logic brick UI now filters for camera objects, which should help
avoid confusion.
2014-02-17 14:38:08 -08:00
Mitchell Stokes
f3c7cb02b2 Fix T37964: KX_GameObject missing NULL checks for m_physicsController.
KX_GameObject::PySuspendDynamics() and KX_GameObjectPyRestoreDynamics()
now make sure GetPhysicsController() is non NULL before attempting
to use it.
2014-02-14 13:17:51 -08:00
Campbell Barton
5621e63d36 Code cleanup: duplicate headers 2014-02-14 10:55:38 +11:00
IRIE Shinsuke
38e58612ef Revert own previous commit rBe2f9afbaabbd.
The "Cast Shadows" worked as expected, but it can cause problem in some cases.
For example, when using strand render, we need disabling only buffer shadows,
but the previous changes made that impossible. "Cast Shadows" should be added
as a newly created option.
2014-02-12 05:46:26 +09:00
Sergey Sharybin
c0a13322cd Fix T38553: Crash load new level; array modifier using curve length
Since threaded object update we've disabled in-place
curve evaluation (in cases when applying curve modifier
with target curve non-evaluated yet).

This requires game engine to take care of DAG and object
evaluation (currently it's designed to export only objects
it able to render).

This workaround will make sure that curve_cache for curves
is up-to-date.
2014-02-11 18:25:53 +06:00
IRIE Shinsuke
e2f9afbaab Blender Internal: Modify material property "Cast Buffer Shadows" to affect ray shadows also, and rename it to "Cast Shadows".
This allows us to make materials that don't cast ray shadows.
Turning off this property can reduce the rendering time slightly.

Note: RNA path is changed to "use_cast_shadows" as well. The older
path "use_cast_buffer_shadows" still can be used as its alias, but
it will be removed after updating some addons.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D272
2014-02-11 17:06:21 +09:00
Campbell Barton
b3afbcab8f ListBase API: add utility api funcs for clearing and checking empty 2014-02-08 06:24:05 +11:00
Mitchell Stokes
88843caaa3 BGE: Fixing memory corruption/double free when duplicating (e.g., addObject) LibLoaded lights. 2014-02-04 14:48:22 -08:00
Mitchell Stokes
6a2c467443 Blenderplayer: Fixing a memory leak.
IMB_moviecache_destruct() was not being called.
2014-02-03 14:25:59 -08:00
Campbell Barton
76543574bc Code cleanup: declarations for removed functions 2014-02-04 07:20:19 +11:00