Commit Graph

878 Commits

Author SHA1 Message Date
Mitchell Stokes
18fda6d84c BGE: Fix for [#34044] "Objects with no material don't have their "face image" always working on bge" reported by Dalai Felinto (dfelinto).
NULL materials are no longer cached.
2013-05-11 03:20:19 +00:00
Mitchell Stokes
b0261a446d BGE: Fix for [#34631] "Textures bad in game mode" reported by pablo aaa (p9ablo).
Disabling caching if materials have Face Textures enabled.
2013-05-11 02:43:35 +00:00
Sergey Sharybin
0cd35ada0d Fix #35177: Press P Crashes Blender After Fracture of Cube
Root of the issue was fixed by Brecht in svn rev56441.
This change only prevents crash of files created in
blender before that fix, and also gives more useable
information about what's wrong (apparently, assert
here was doing nothing).
2013-05-02 09:45:00 +00:00
Campbell Barton
3f7f07faf5 style cleanup 2013-04-18 01:52:38 +00:00
Mitchell Stokes
8051ab07fc BGE: Cleaning up BL_ShapeDeformer's use of Blender's Key. This also fixes a bug with replicas (added objects) crashing when using shape keys. 2013-04-14 18:54:06 +00:00
Campbell Barton
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
Campbell Barton
e1a54214bb code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
2013-03-25 02:41:30 +00:00
Campbell Barton
9379dcb507 code cleanup: unused defines, shadowing and unintended enum-as-variable. 2013-03-22 14:31:03 +00:00
Campbell Barton
dd0e2da784 code cleanup: use booleans and const's for operator vars. 2013-03-22 04:40:45 +00:00
Dalai Felinto
5ef9a20671 BGE bugfix for [#34505] Vertex Colors not working in the BGE (for custom GLSL shaders) when multitexture and no material
Bug introduced on rev.36723
2013-03-21 23:20:46 +00:00
Campbell Barton
f254ba77fd code cleanup: conversion from blender to BGE was unnecessarily confusing in checking weather to use vertex colors,
move check to function.
2013-03-21 23:11:52 +00:00
Dalai Felinto
6d8b3d2d94 BGE bugfix: [#34550] getVertexArrayLength changed in 2.66
This bug was producing way more geometry than we need. Potentially
memory saver (or performance even) bugfix.

Bottomline is:
We need to initialize the UVs otherwise vertex comparison fails ...
Ideally MoTo should take care of initializing MT_Point2
(note in Windows that seems to be fine, but it's safer to not rely on that)
2013-03-21 21:10:14 +00:00
Campbell Barton
655ed9cc7f style cleanup 2013-03-18 11:44:56 +00:00
Campbell Barton
09c41019a8 use const pointers for file loading and booleans for animation system return values passed as pointers. 2013-03-17 19:13:04 +00:00
Mitchell Stokes
db6d34daad BGE: Fix for bugs #34428, #20856, #20281. These were all multi-uv bugs caused by the BGE keeping too much uv information. When setting up shaders the BGE assumes each UV layer is unique, but the converter would store duplicates. 2013-03-02 18:05:52 +00:00
Campbell Barton
166de48ca4 code cleanup: confusingly written and named function for BGE materuial conversion: getImageFromMaterial() --> getMTexFromMaterial() 2013-02-23 07:36:40 +00:00
Campbell Barton
dddee08f27 code cleanup: bge material conversion was creating STR_String just to check for empty string for no reason (empty string was assigned irrespective). 2013-02-23 07:15:37 +00:00
Campbell Barton
e42e570ff4 BGE: fix for uninitialized tangents 2013-02-23 04:49:46 +00:00
Mitchell Stokes
87ab622463 BGE: Fix for bug #34377 "Multi UV mesh's materials not backwards compatible and Odd UV Coord behavior" reported by Alex Mairs (ctbm). The problem was the unused texture slot was still trying to be used. Now unused texture slots' mappings are set to DISABLE so they don't mess up the rest of the conversion process. 2013-02-23 04:15:47 +00:00
Mitchell Stokes
e4febef1fb BGE: Finally moving material IPOs to the 2.60 BGE animation system (BL_Action). It was kind of a fluke that they worked before. 2013-02-23 02:47:22 +00:00
Mitchell Stokes
d05cb9bca5 BGE: (partial?) fix for #34330 "Action Actuator "caching" the previous ran actions" reported by Dalai. The test file now works if all of the actions are using the same layer, but multiple layers can still cause problems. However, I am unsure as to what the "correct" behavior should be with multiple layers. They should probably blend somehow... 2013-02-22 23:55:06 +00:00
Alexander Kuznetsov
2c2a42a4e8 Fix for building without python. 2013-02-22 15:54:10 +00:00
Mitchell Stokes
815e00917d BGE cleanup: Removing the PHY__Vector classes and replacing them with MT_Vectors. The PHY__Vectors didn't offer anything (not even any real abstraction) and they required annoying MT_Vector <-> PHY_Vector conversions all over the place. No functional changes. 2013-02-21 18:30:11 +00:00
Mitchell Stokes
8c9906eb91 BGE: Fix for issue #34242 "It does not render in "P" mode for Game engine if you UV mapa a face of a cube" reported by joaclint.
Material caching can now be disabled for Multitexture and GLSL Materials.
2013-02-16 04:38:53 +00:00
Ton Roosendaal
00212f2b1f Bug fix #34157
Tss tss! :)
This bug (since Jan 26) made Material options get cleared on using GE once.
2013-02-09 12:30:42 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +00:00
Mitchell Stokes
9191b783bb BGE: Some various changes to make moving the character physics type easier:
* Undoing the previous applyMovement() changes for characters. This was causing bugs for the Motion Actuator.
  * Creating a Character Motion type for the Motion Actuator with specific controls for characters. This includes moving, rotating and jumping.
  * Adding a KX_CharacterWrapper.walkDirection to set the character's direction and speed.

Note, this also resolves the following bugs:
[#33585] "Setting dLoc of motion actuator [0,0,0] via python won't stop object" reported by Manuel Bellersen (urfoex)
[#33503] "Character physics type won´t accept more than one motion anymore" reported by Mr Larodos
2013-01-30 05:55:17 +00:00
Dalai Felinto
4d8104917d BGE bugfix: Material initial object color working in the game
The object color option in the materials always worked, however the initial color of the object
was never passed to the game.

We are now passing it only, only when the object's mesh has a material that has ((shade_flags & OB_COLOR)).
There reason to not always set the object color is probably due to performance (the m_bUseObjectColor
flag in KX_GameObject). This patch still respect that.

Bug report from Mike Pan, as part of our book nitty-gritties review work.
Bugfix during Vancouver Global Game Jam :)
2013-01-26 23:52:55 +00:00
Campbell Barton
69ddc5eb99 make bullet optional again 2013-01-23 07:26:39 +00:00
Sergey Sharybin
cf0e646432 Remove usage of deprecated TEX_USEALPHA from GE code 2013-01-05 13:51:07 +00:00
Mitchell Stokes
9106b3b107 BGE: Fix for [#33769] "Material friction settings are ignored" reported by Alex Fraser (z0r).
As of r53332, give_current_material() won't accept a 0 index and return NULL. CreateMaterialFromBlenderObject() was using index 0 to just grab the first material. Since this now returned NULL, it would use default settings. We'll just ask for index 1 now instead.
2013-01-05 08:53:39 +00:00
Campbell Barton
c2839bfe76 add option WITH_SYSTEM_BULLET to link against the bullet installation found on the system.
Note: this doesn't work yet for everything with latest stable bullet (2.81), need to look into why and likely apply some patches upstream.
However I managed to link blender by disabling some features, likely it can be made to work without too much trouble.
2013-01-03 00:23:52 +00:00
Mitchell Stokes
f1270153e1 BGE: Some various tweaks to try and get async lib loading to be a bit more stable on more complex scenes. 2012-12-25 08:11:21 +00:00
Mitchell Stokes
a1c9241797 BGE: "Fix" for issue [#33663] "Objects Share Materials / Textures When Grouped In SingleTexture / MultiTexture Mode" reported by Josiah Lane (solarlune).
This commit adds a UI option in the Render properties to enable the new material caching in the converter. This caching can cause problems with Singletexture and Multitexture materials when texface is being used to handle materials. By default this option is enabled and users with broken games have two options:

  1) Fix up their materials so they are properly using textures
  2) Disable the material caching and take a speed hit during conversion time

Regardless of the setting, caching is always enabled for GLSL materials.
2012-12-24 03:13:53 +00:00
Bastien Montagne
ba14beb000 Code cleanup: add usual 'BKE_' prefix to 'public' constraint functions from blenkernel... 2012-12-23 11:31:15 +00:00
Mitchell Stokes
84966c3d0a BGE: Committing async LibLoad from Swiss. This does the lib loading in a separate thread to keep the BGE from freezing. Here is an example from the docs:
# Print a message when an async LibLoad is done
      import bge

      def finished_cb(status):
          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))

      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb

LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes.
2012-12-22 05:38:32 +00:00
Campbell Barton
0ddc77f913 code cleanup: warnings 2012-12-19 01:48:54 +00:00
Mitchell Stokes
ef0473994b BGE: Some as of yet unmerged work I did in the Swiss branch. These changes include:
* Cleaning up the conversion code to avoid a per-face material conversion. Materials are now stored in buckets and only converted if a new material is found. This replaces some of Campbell's earlier work on the subject. His work wasn't as thorough, but it was much safer for a release.
  * Shaders are only compiled for LibLoaded materials once. Before they could be compiled twice, which could really slow things down.
  * Refactoring the rasterizer code to use a strategy design pattern to handle different geometry rendering methods such as immediate mode, vertex arrays and vertex buffer objects. VBOs are added, but they will be disabled in a following commit since they are still slower than vertex arrays with display lists. However, VBOs are still useful for mobile, so it's good to keep them around.
  * Better multi-uv support. The BGE should now be able to handle more than two UV layers, which should help it better match the viewport.
2012-12-18 20:56:25 +00:00
Brecht Van Lommel
779375251c Fix #33487: game engine did not convert objects with rotation modes other than
Euler XYZ correctly, was never implemented;
2012-12-17 21:40:28 +00:00
Bastien Montagne
ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Campbell Barton
050f09aa6c buildsystem cleanup: remove duplicate source & includes for scons,
add a check for duplicates in BlenderLib()m, if 0'd now.
2012-11-14 01:41:24 +00:00
Campbell Barton
83de5cb308 bge mesh conversion speedup, avoid calling ConvertMaterial() on every face.
now do per material bucket.
2012-11-11 01:54:30 +00:00
Campbell Barton
dfc55421df game engine material conversion: don't use the material to convert vertex colors, then extract back out (pre face). 2012-11-11 00:39:08 +00:00
Campbell Barton
f8af8100d2 code cleanup: bge - rename 'type' to 'use_mcol' in material conversion. 2012-11-10 23:57:13 +00:00
Campbell Barton
936f0388e8 code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
Antony Riakiotakis
8d0b2bc17f Compile fixes for recent boost changes 2012-11-05 15:23:09 +00:00
Joerg Mueller
5a8d5f77af Audaspace:
Replacing AUD_Reference with boost::shared_ptr.
2012-11-05 14:24:35 +00:00
Mitchell Stokes
3bf9bb3b13 BGE: Adding support for Bullet's collision masks. Each object now has a collision mask and a collision group. Object A and object B collide if object A's groups is in object B's mask and object B's group is in object A's mask. In other words, the group defines what the object is (collision wise) and the group defines what the object can collide with.
The majority of this patch was provided by Kupoman with some edits from me and heavy testing by z0r.
2012-10-30 15:44:16 +00:00
Campbell Barton
5549904171 style cleanup 2012-10-29 02:11:40 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00