Commit Graph

13042 Commits

Author SHA1 Message Date
Brecht Van Lommel
c35299363f Fix for bug #18659: glsl math material node, "tangent" option didn't work. 2009-05-03 13:17:37 +00:00
Ton Roosendaal
b89126dbe8 Bugfix #18676
Map a texture to Material Ambient factor didn't work. 
Probably not since 2.42 or so... :)
2009-05-03 12:06:43 +00:00
Ton Roosendaal
12a5c03d16 Bugfix #18671
Texture Nodes: the option to use nodes was also visible for textures
on world, lamp, brush. Since it only works for Materials now, I've made
the button disappear then.
2009-05-03 11:25:09 +00:00
Campbell Barton
22b501c791 fixes for bugs submitted by BGE users, fixes by myself and Mitchell Stokes
- when the attribute check function failed it didnt set an error raising a SystemError instead
- Rasterizer.getMaterialMode would never return KX_BLENDER_MULTITEX_MATERIAL
- PropertySensor value attribute checking function was always returning a fail.
- Vertex Self Shadow python script didnt update for meshes with modifiers.
2009-05-03 09:21:58 +00:00
Campbell Barton
b0ec497f39 [#18492] Old 3dView painting does't work anymore.
use flag the wrong way
2009-05-03 09:03:47 +00:00
Campbell Barton
6b0f7c741e [#18191] VSE: when moving a project containing a relative path Audio RAM strip, it is still pointing old file
Its a bit silly its not using the name from the file selector alredy (which has been made relative), but this fixes the bug.
2009-05-02 21:11:48 +00:00
Campbell Barton
490dad89d5 fix for a painting bug where disabled culling & occlusion would not paint onto backfaces
also use the math floating point functions sqrt -> sqrtf, fmod -> fmodf etc.
2009-05-02 19:46:54 +00:00
Campbell Barton
40fc1d2af7 BGE PyController module type.
- Added support for any number of attributes, this means packages are supported automatically.
 so as well as "myModule.myFunc" you can do "myPackage.myModule.myFunc", nested packages work too.
- pass the controller to the python function as an argument for functions that take 1 arg, this check is only done at startup so it wont slow things down.

added support for
2009-05-02 15:09:06 +00:00
Campbell Barton
41f42099ac BGE Py API patch from Mitchell Stokes, add distance attribute to the radar sensor, dont use 'continue' because its a python keyword.
removed (ssizeobjargproc) it breaks py2.3
2009-05-02 04:53:01 +00:00
Campbell Barton
ef20036b84 BGE Py API patch from Mitchell Stokes, adds extra attributes and docs 2009-05-02 02:40:11 +00:00
Benoit Bolsee
07abb9dee2 BGE performance:
- Vast performance increase when removing scene containing large number of 
  objects: the sensor/controller map was updated for each deleted object, 
  causing massive slow down when the number of objects was large (O(n^2)).
- Use reference when scanning the sensor map => avoid useless copy.
- Remove dynamically the object bounding box from the DBVT when the object
  is invisible => faster culling.
2009-05-01 20:34:23 +00:00
Benoit Bolsee
e13a089d91 BGE: work around a problem with DBVT culling when graphic objects are rescaled. This happens when objects with very diverse scale are instantiated with dupligroup. The problem remains when the objects are rescaled during the game. The effect of the problem is an inefficient culling: objects can have a bounding box larger than needed. Patch to fix the problem is filed at Bullet forum. 2009-05-01 19:02:23 +00:00
Benoit Bolsee
672492f563 BGE: New function GameLogic.setMaxLogicFrame() to allow better control over the time spent on logic.
This function sets the maximum number of logic frame executed per render frame.
Valid values: 1..5

This function is useful to control the amount of processing consumed by logic.
By default, up to 5 logic frames can be executed per render frame. This is fine
as long as the time spent on logic is negligible compared to the render time. 
If it's not the case, the default value will drag the performance of the game
down by executing unnecessary logic frames that take up most of the CPU time. 

You can avoid that by lowering the value with this function. 
The drawback is less precision in the logic system to physics and I/O activity.
	
Note that it does not affect the physics system: physics will still run 
at full frame rate (actually up to 5 times the ticrate).
You can further control the render frame rate with GameLogic.setLogicTicRate().
2009-05-01 16:35:06 +00:00
Kent Mein
1c6cd47f2b Fix linking issue with gameplayer.
Kent
2009-05-01 15:19:47 +00:00
Campbell Barton
742ddade12 [#18654] different behaviour if script is called from (1) Menu (2) TextEditor (3) ScriptsWindow [including crash!]
bugfix, simple NULL check
2009-05-01 14:19:56 +00:00
Campbell Barton
bb3fa18a95 add blendfile dirs to the sys.path without the scripts subdir 2009-05-01 04:55:40 +00:00
Benoit Bolsee
36d0e2649e BGE bug fix: when a dynamic object is parented to a compound shape and then unparented, it jumps at the position it had before the parenting. 2009-04-30 20:02:22 +00:00
Benoit Bolsee
2ec50d7bb2 BGE bug #18091: Hitbox of object X doesn't move along when object X is parented to object Y. 2009-04-30 19:00:17 +00:00
Dalai Felinto
8570071e40 supporting warp data files with tabs instead of spaces. 2009-04-30 15:27:38 +00:00
Campbell Barton
fdf6ea916d added Geometry as a BGE module, removed its dependency on gen_utils.c 2009-04-30 12:45:13 +00:00
Ton Roosendaal
de2cc4d14d Second trial to get an OK menu work to allow people to decide whether
or not to use a 2.5+ saved file in 2.49. Apparently the msvc linker
was choking on it?
2009-04-30 10:11:37 +00:00
Benoit Bolsee
81ea467091 BGE fux #17796: Glsl + bones + set smooth = bug on vertext groups. 2009-04-30 08:02:26 +00:00
Campbell Barton
b5b24ee521 BGE Python sys.path for the blenderplayer and blender
sys.path is the search path for python modules. This is useful so people making games can put all their scripts in a folder and be sure they will always load into the BGE.

for each blend file a scripts directory is added to the path
 /home/me/foo.blend
will look for modules in...
 /home/me/scripts/*.py 

It could also default to look for modules in the same directory as the blend file but I think this is messy.
Added a note in the tooltip about //scripts so its not such a hidden feature.

This works by storing the original sys.path, then adding the paths for the blendfile and all its libs,
when a new blendfile is loaded, the original sys.path is restored before adding the blendfiles paths again so the sys.path wont get junk in it.

One problem with this - when using linked libs the module names must be unique else it will load the wrong module for one of the controllers.

also fixed 2 bugs
- sys.path in the blenderplayer was growing by 1 for every file load in blenderplayer
- the relative path (gp_GamePythonPath), wasnt being set when loading files in the blenderlayer (as I wrongly said in the last commit).
2009-04-30 08:01:31 +00:00
Dalai Felinto
939290b59c BGE 2dFilters: Revert of part of own commit [rev. 19687]
Therefore we still need to find a better way to solve this problem:
[#18154] 2dFilter and motion blur should run only once to all the scenes:
http://projects.blender.org/tracker/?func=detail&aid=18154&group_id=9&atid=127
2009-04-30 03:46:31 +00:00
Dalai Felinto
5908e2aa77 BGE Dome update. Spurious black seams (finally) fixed.
The solution is a hack. It's a workaround for another bug (#18655).
Now it's working in all modes: fullscreen, maximized screen and gameplayer.

* small change to always set the perspective mode as true during dome mode.
2009-04-30 02:41:07 +00:00
Campbell Barton
199341ad7b 2 BGE bugs from 2.48 fixed
- the gp_GamePythonPath relative path variable wasnt updated when loading new files.
- missing NULL check for scene crashed blender when it failed to load a file.
Both problems dont affect blenderplayer
2009-04-30 02:07:08 +00:00
Campbell Barton
1782be5c72 Not sure why this INCREF is needed since making a replica wont use the m_bytecode so why should it add a user?
Removed in 19974 but that crashes YoFrankie so adding back in for now.
2009-04-30 00:51:11 +00:00
Campbell Barton
a625f5e476 error in last commit 2009-04-29 23:59:59 +00:00
Martin Poirier
6a155b5c07 use BLO_sys_types.h instead, it's windows proof 2009-04-29 23:43:12 +00:00
Campbell Barton
1e7df58519 python modules in the game engine could point to builtin modules like GameLogic that was cleared.
I added module clearing before there was checks for invalid python objects, so now its not needed for BGE Builtin types at least.

also made the builtin modules get re-used if they already exist and clear all user modules when the game engine finishes so with Module-Py-Controllers the referenced modules are at least up to date when pressing Pkey.
2009-04-29 23:39:27 +00:00
Martin Poirier
537b080379 missing stdint.h include 2009-04-29 23:33:04 +00:00
Nathan Letwory
ebf631b3fe * instead of using okee() (breaking builds) use error() in 250 subversion handling in 2.49 2009-04-29 22:09:28 +00:00
Nathan Letwory
4d7017b423 * make sure header file agrees with editfont.c (unsigned long -> uintptr_t), following commit by Genscher r19983 2009-04-29 20:56:27 +00:00
Nathan Letwory
39caa9898c * fix linking problem for mingw with setenv/_putenv_s, here we use putenv("key=val"); 2009-04-29 20:09:08 +00:00
Brecht Van Lommel
604f3e08d3 Possible fix for bug #18648: one armature disappears when joining
armatures. Not sure it actually fixes the problem because I can't
test this on Win 64, but this fixes use of unitialized memory at
least. Mat4MulMat34 only sets the 3x3 part of the 4x4 matrix, which
may lead to a NaN bone roll value.
2009-04-29 19:33:05 +00:00
Daniel Genrich
a9aac77ccf Win64 fixes - I don't think that they introduced any bugs yet, but I want to be sure. Please report problems. 2009-04-29 19:13:32 +00:00
Ton Roosendaal
11dcf7461c Bugfix #18632
Duplicating an armature, with constraints having a local Ipo, didn't
make a copy of this Ipo too, frustrating its drivers too.
2009-04-29 17:41:41 +00:00
Campbell Barton
70bcdb817b was testing this, didnt mean to commit. 2009-04-29 17:01:35 +00:00
Campbell Barton
81dfdf8374 ifdef's for future py3 support, after this adding py3 can mostly be done with defines or batch renaming funcs (with the exception of CListValue slicing)
.
No changes for py2.x.
2009-04-29 16:54:45 +00:00
Campbell Barton
d6c525d624 attempt to fix for py2.3 2009-04-29 16:48:00 +00:00
Ton Roosendaal
11ad5f8389 Bug, reported by venomgfx:
Scrub frames in Sequencer image window stopped working. Was in a commit
from Joshua last july, with greasepencil fixes. No idea why he disabled
it, doesn't seem to harm gpencil at all (not in sequencer supported).
2009-04-29 16:41:18 +00:00
Ton Roosendaal
133c91dd2f Bugfix #18649
Grease pencil, floating panel, "Delete last stroke" crashed when there 
were no strokes. Simple NULL check added.
2009-04-29 16:16:08 +00:00
Ton Roosendaal
f56bfbdd0c Bugfix from own testing:
Blender crashed, when started in debug -d, with compositor, after render.
Reason was the BKE_image_print_memlist() which reads the ibuf->rect from
all images, but for Image types "VIEWER" that's not valid, this data is
coming from other sources.
2009-04-29 16:07:10 +00:00
Ton Roosendaal
3b19b6c33f 2.5+ file read provision for 2.49
I've managed to find a basic fail-safe method to prevent using the read
data with an OK popup. I then still will read the file, but wait for user
confirmation to continue, or just free the database.

The pupup tells the user that at least animation data will be lost.

For background renders of 2.5+ things are more tricky, so here I've added
a default failure to read, returning 0, which will typically gracefully
quit blender.
2009-04-29 15:25:13 +00:00
Campbell Barton
f8656d3510 BGE alternative run mode for python controllers.
Option to run a function in a module rather then a script from a python controller, this has a number of advantages.

- No allocating and freeing the namespace dictionary for every time its triggered
  (hard to measure the overhead here, but in a test with calling 42240 scripts a second each defining 200 vars, using modules was ~25% faster)

- Ability to use external python scripts for game logic.

- Convenient debug option that lets you edit scripts while the game engine runs.
2009-04-29 12:43:09 +00:00
Ton Roosendaal
988fbb88dc bugfix #18609
This fixes a commit from Peter, revision 12931, Dec 17 2007
He added quick image scaling code, derived from ppmqscale, 
http://libdv.sf.net

This implementation gave ugly banding. especially visible on
dark colors or byte images with very close colors.

Solution is to add correct rounding, seems to me normal for such
fixed point magic. Optimizing code and keeping quality is tricky
dudes! Results for scaling down in sequencer were bad for over a
year (2.47 and 2.48 both wrong).
2009-04-29 11:20:07 +00:00
Campbell Barton
32b70e333f needed this minor change to build on gcc 2009-04-29 11:16:26 +00:00
Campbell Barton
3bc02088e8 remove uneeded checks and testMethod from KX_ConstraintWrapper, typo in import_obj 2009-04-29 10:24:12 +00:00
Benoit Bolsee
f004c36e41 BGE: speed up mesh conversion by avoiding allocation/deallocation of material object on each face. The speed up is minor on optimized builds but considerable on less optimized builds, good for debugging large scene. 2009-04-29 10:06:38 +00:00
Erwin Coumans
2d78dcfb61 fix so that torque can be applied to DYNAMIC game objects, this fixes the skategirl.
Note that skategirl needs a bit higher angular damping, perhaps the conversion formula needs to be tweaked better?
2009-04-28 23:26:35 +00:00