Commit Graph

836 Commits

Author SHA1 Message Date
Nick Samarin
d3d2e92fcc synched branch with trunk at revision 29109 2010-05-31 23:44:43 +00:00
Nick Samarin
05b92f0fc9 Added new actuator type for following steering behaviors: seek, flee, path following; renamed KX_Pathfinder to KX_NavMeshObject 2010-05-31 22:35:22 +00:00
Nick Samarin
d7a701c2c5 - added new game object type for navigation mesh
- added py api for path finding and ray casting
- set svn properties for KX_Pathfinder
2010-05-27 20:18:56 +00:00
Nick Samarin
56784fcde9 added converting mesh of game object to Detour StatNavMesh (game object is defined by property "navmesh") 2010-05-19 01:42:17 +00:00
Campbell Barton
c2ffcb8497 no functional changes
- add PySequenceMethods members (all NULL)
- spaces -> tabs
- cmake syntax warning from recent ghost commit
2010-05-16 10:09:07 +00:00
Campbell Barton
b28c6d3c14 bugfix for own error [#22269] object vector operations (position) not working properly after rev. 28471
double checked other get_index callbacks for the same error.
2010-05-06 22:07:03 +00:00
Campbell Barton
b63d069055 [#22177] Adding BLF to the BGE and exposing BLF_load as blf.load
from Mitchell Stokes (moguri) 

also updated blf docs
2010-05-05 06:38:49 +00:00
Campbell Barton
124c55fcc3 remove redundant argument from mathutils callbacks 2010-04-27 19:21:36 +00:00
Campbell Barton
6bb55fd93e py/rna, euler objects order is now wrapped correctly...
eg:
 eul = bpy.context.object.rotation_euler
 eul.order = 'XZY' # will update the objects setting.
2010-04-26 21:04:42 +00:00
Campbell Barton
93f420b666 correct typo's 2010-04-25 15:24:18 +00:00
Dalai Felinto
edc56fae18 BGE Fix: [#19951] mouse over sensor is broken with letterboxing framing
Tested with GameLogic.mouse.position and mouse over sensor.
It should be working with other mouse sensor as well. If not, please help to test and report a bug.
(couldn't test blenderplayer but it should be working there as well).

(Benoit, this is the same patch that I sent you. I hope it's OOP enough. Looking forward to hear from you on that)

I believe that this was the last "mouse" related bug we had reported. MouseLoook scripts should be working 100% in Blender/BGE 2.50 now \o/
2010-04-23 22:48:26 +00:00
Matt Ebb
45abe2baf2 Added F13 - F19 keys for game engine too. 2010-04-20 01:04:00 +00:00
Campbell Barton
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
Campbell Barton
45441c07d4 various minor fixes
- collada export would run MEM_freeN on an un-initialized pointer in some cases.
- makesrna was missing a call to close a file.
- text cursor update function was missing a NULL check for st->text.
- possible (unlikely) un-initialized return value for bge python lamp.type, set error instead.
- possible (unlikely) missing NULL terminator with strncpy for ffmpeg.
2010-04-18 09:12:18 +00:00
Campbell Barton
392e1da179 bugfix and cleanup
- BGE Shader.setSampler(name, index): index range check was wrong.
- Compositor check for an invalid channel was incorrect.
- getting the center of selected verts used an uninitalized z axis.
- do_init_render_material() used && rather then & when testing for MA_TRANSP.
- weight paint activate flipped bone used && rather then & for flag checking.
2010-04-17 15:47:00 +00:00
Dalai Felinto
795b438bf5 Patch #21789 - BGE Keyboard and Mouse Python types - by Mitchell Stokes(Moguri)
The patch exposes mouse and keyboard read-only properties in the GameLogic module
Also renames bge.keys to bge.events (* Note: name of bge submodules (logic, render, ...) may change before 2.5 final release [right Campbell?]).

"""
This patch adds two new types to the BGE:
SCA_PythonKeyboard
SCA_PythonMouse

These two types allow users to make use of the keyboard and mouse without the need for a keyboard or mouse sensor.

SCA_PythonKeyboard has an events property that acts just like SCA_KeyboardSensor.events.

SCA_PythonMouse also has an events property to check for mouse events. Further more it supports getting and setting normalized cursor position (from 0.0 to 1.0) with SCA_PythonMouse.position. The cursor can be shown/hidden using SCA_PythonMouse.visible.
"""

Its use is similar with current mouse and keyboard controllers. With the exception of mouse position being normalized and writable as well (replacing Rasterizer.setMousePosition).

Code Sample:
######
from bge import logic, events

mouse = logic.mouse
keyboard = logic.keyboard

for key,status in keyboard.events:
    if status == logic.KX_INPUT_JUST_ACTIVATED:
        if key == events.WKEY:
            print(mouse.position)
            # move_forward()

mouse.visible = True # turn cursor visible
mouse.position = 0.5,0.5  # centralize mouse - use tuple
######

* Important Note: mouse.position still will not work properly for Letterbox mode.
In order to fix letterboxing I may need to move the set x,y mouse function to inside the canvas code (to avoid duplicated code between mouse sensor and bge.logic.mouse). I'll leave this for another commit though.
Thanks Mitchell for the work on that.
2010-04-17 06:52:14 +00:00
Campbell Barton
67cfc427ee PyAPI
- added new mathutils.Color() type, use with rna so we can do for eg:
 material.diffuse_color.r = 1.0
 # also has hsv access
 material.diffuse_color.s = 0.6

 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
Campbell Barton
fe9a22a018 py api file rename
- prefix mathutils api.
- 2 blf.c files (annoying for debugging)
- py api docs ignore keying sets as with operators.
2010-04-11 12:05:27 +00:00
Dalai Felinto
ea0e0b3f15 BGE fix: Parenting the object to itself crashes BGE + stubs update
it may happen if you start doing exec, setParent, ... in Python
not a big deal, but to crash Blender is always bad
2010-03-31 22:49:59 +00:00
Benoit Bolsee
03c81862c4 BGE patch [#21019]: Python function for Scene suspend/resume. 2010-03-28 20:50:20 +00:00
Dalai Felinto
822dcc48cd bgl/BGE: glCopyTexImage2D + bgl.buffer creation error more verbose + dome post_draw (it draw only for the last overlayed scene)
1) glCopyTexImage2D - www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml

2) dome post_draw. Now dome mode can also use scene.post_draw. It only runs for the last scene. It's really useful. I'm working on a nice showcase for this (a dome visualizer for the dome mode running with bgl. In the mean time this is a (lame) example of both working together (the buffer is being copied and draw on top of the window):
http://blenderecia.orgfree.com/blender/tmp/dome_bgl_copytex2d.jpg
2010-03-28 10:20:26 +00:00
Benoit Bolsee
3ed81eeccf BGE: [#19836] Recursive Parenting in game crashes Blender. Added parenting loop detection. 2010-03-25 21:43:36 +00:00
Campbell Barton
377f06082a enable compiling without python again 2010-03-23 21:37:02 +00:00
Guillermo S. Romero
42ac4a3e7d Fix syntax for ID keyword. 2010-03-21 01:14:04 +00:00
Campbell Barton
b9211135ef [#21261] Bugfix for dynamically loaded scenes' lights not mixing in multitexture
from Mitchell Stokes (moguri)
2010-03-10 07:41:16 +00:00
Campbell Barton
1708ac0723 rename some functions to use easier to understand names.
'BLI_makestringcode' --> 'BLI_path_rel'
'BLI_convertstringcwd' --> 'BLI_path_cwd'
'BLI_convertstringframe' --> 'BLI_path_frame'
'BLI_convertstringframe_range' --> 'BLI_path_frame_range'
'BLI_make_cwdpath' --> 'BLI_path_cwd'
2010-03-09 17:36:23 +00:00
Campbell Barton
b356eb6a8b image re-project now uses offscreen render function and has input for render size.
unrelated changes that ended up being more trouble to commit separate...

- removed BLI_split_dirfile(), was nasty, occasionaly modifying the source string, it could create directories and used the $CWD in some cases. was only used in 2 places in filesel.c, if this gives problems can address without bringing back this function.
  renamed BLI_split_dirfile_basic --> BLI_split_dirfile

- view3d_operator_needs_opengl was being called for offscreen render when it wasnt needed.
2010-03-08 20:08:04 +00:00
Dalai Felinto
0cad3ae24c BGE 2D Filters: filters run per scene now (fix for [#18152]) - it (slightly) breaks backward compatibility !!!
Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use.

(1) Performance - To run the filters 2X == 2X slower
(2) flexibility of use - Very often we want the filter in the scene but not in the UI for example.

For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now.
To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes.

* * * * *

Imagine that we have:
(a) Main Scene
(b) Overlay Scene

in Main Scene the Z Buffer and RGB will be from the main scene.
in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b].

So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
2010-03-03 06:38:47 +00:00
Campbell Barton
ed7f4f2e3c make BGL and BLF modile names lowercase 2010-02-28 14:57:26 +00:00
Campbell Barton
4ef1fd1078 game engine support for recording animation back & some other minor changes. 2010-02-22 12:25:58 +00:00
Campbell Barton
b65a983d39 use BLI_findstring in more places & remove some warnings, no functional changes. 2010-02-22 09:22:36 +00:00
Martin Poirier
71125002a9 No need for this change anymore (force include to get BLO_sys_types.h in GE) 2010-02-20 22:51:22 +00:00
Elia Sarti
f7d82af101 Compile fix for CMake 2010-02-20 22:38:21 +00:00
Campbell Barton
ea8b072b75 [#21023] 2 Dynamic loading patches (one bugfix, one feature)
patch from Mitchell Stokes (moguri), only the bugfix part for now.
2010-02-15 09:01:52 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Dalai Felinto
2541429ded BGE: linear velocity and angular velocity are attributes now
... what lead me to wonder if we should remove obj.setAngularVelocity, obj.setLinearVelocity, obj.getLinearVelocity and obj.getAngularVelocity.

* this was so Copy and Paste ... anyways tests are welcome (I never used those methods in python myself).
2010-02-12 03:40:28 +00:00
Joerg Mueller
9827a3e9ea 2.5 Audio:
- recode of the whole sequencer audio handling
- encode audio flag removed, instead you choose None as audio codec, added None for video codec too
- ffmpeg formats/codecs: enabled: theora, ogg, vorbis; added: matroska, flac (not working, who can fix?), mp3, wav
- sequencer wave drawing
- volume animation (now also working when mixing down to a file!)
- made sequencer strip position and length values unanimatable
2010-02-07 23:41:17 +00:00
Benoit Bolsee
3e598e7468 BGE: Fix typo in SConscript preventing to import VideoTexture module. 2010-02-07 16:52:19 +00:00
Martin Poirier
3bd78cf8f6 Wrong argument name for scons 2010-02-07 14:59:00 +00:00
Benoit Bolsee
81fd89c8e0 BGE: VideoTexture was not included, missing WITH_FFMEG defined. Fixed in all building system. 2010-02-07 14:12:39 +00:00
Dalai Felinto
f7a24a25ba BGE: Sound Actuator API
act.time can set the sound position (float in seconds)
act.is3D RO gives you the dimension of the audio
act.minGain3D, maxGain3D ... set the 3D parameters of the sound

** PyDoc to be done. Jörg Müller (NeXyon) do you want to document them? The file is here:
//source/gameengine/PyDoc/GameTypes.py


+ adding a missing \n to KX_Scene.cpp. (kind of typo)
2010-02-05 00:51:32 +00:00
Dalai Felinto
f32df64d2b BGE fix: KX_Lamp using strcmp wrongly + typo in rna_define 2010-02-04 23:51:41 +00:00
Benoit Bolsee
0020de72e4 BGE: Optimize Soft body conversion: don't create BVH structure.
A btBvhTriangleMeshShape object is created when converting
a mesh to physics, also in case of Soft body although the
soft body will not use it (it only uses the mesh interface).

This patch keeps this system for compatibility with the
KX converter but avoids the creation of the BVH structure,
which consumes a lots of CPU. This should speed up
significantly the conversion of large mesh to softbody.

A secondary optimization is that the sharing of shapeInfo
is extended to rigid body using gImpact. Before it was
only active between static body and soft body.
2010-02-03 21:41:03 +00:00
Campbell Barton
1943a73439 rename game object obcolor to color 2010-01-30 21:59:20 +00:00
Benoit Bolsee
f7b7d7952d BGE: patch [#20293] Added python sensor attribute: Status. 2010-01-30 18:53:33 +00:00
Benoit Bolsee
cfdd53a4f8 BGE: patch #20399 Python control over adding/removing scenes. 2010-01-30 18:23:13 +00:00
Dalai Felinto
9356b1b7ee BGE: Mouse Sensor type defaults to 1 (MOUSELEFT ) + remove camera attribute from Camera objects.
(if you want to mark your camera objects create a property manually ;)

That way object.getPropertyNames() works consistently across all object types.
2010-01-17 21:46:34 +00:00
Campbell Barton
68c8054191 patch [#20560] [patch] KX_GameObject.obcolor
by Mitchell Stokes (moguri)
* renamed attribute obcolor to color
2010-01-16 23:53:51 +00:00
Campbell Barton
b0f87935a8 spelling errors, no real changes to code. 2010-01-14 10:59:42 +00:00
Campbell Barton
1cb013f877 evil 1 liner to get bge.logic, bge.render, bge.keys etc.. may eventually replace GameLogic, GameKeys module names. 2010-01-10 22:15:29 +00:00