Commit Graph

1541 Commits

Author SHA1 Message Date
Campbell Barton
610c4befd4 option to copy constraints without making their ID references direct links.
needed because proxies are causing libs to be linked directly when they should be kept indirect (likely slowing load times though I didnt time this)
2010-04-29 15:31:53 +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
Campbell Barton
ed4377faa7 replace referenecs to python 2.x 2010-04-20 15:46:28 +00:00
Dalai Felinto
dd2080f5c4 BGE EPY Docs: PhysicsConstraints and fixes in other modules
PhysicsConstraints module documented by Jean-François (Ninja Goliath) based on GameKit 2nd ed.
Thanks for the initiative and the great help!

General advice for anyone helping with EpyDocs:
* use :: instead of : to keep the indentation correct,
* use B{} for clarity when needed (e.g. createConstraints)

Adding F13 to F19 to complement Matt's recent commit
* There are other (not so important) functions in PhysicsConstraints module that are not exposed in the documentation right now.

The generated page is temporarily here, if someone want to review it:
http://blenderecia.orgfree.com/blender/tmp/PhysicsConstraints-module.html
2010-04-20 08:23:22 +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
Guillermo S. Romero
00e46ef739 SVN maintenance. 2010-04-17 22:43:18 +00:00
Campbell Barton
4cf697de89 - for BGE mouse and keyboard events use tuples rather then lists
- pep8 corrections
2010-04-17 19:05:53 +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
Guillermo S. Romero
7d9067ca2c Make memstat easier to read, add missing Intel ID and cleanups. 2010-04-14 21:12:05 +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
a8bca52d09 BGE fix #20456 - 2.5: mouse position problem (offseted by 1 vertically)
In Blender 2.49 the win width and height were been calculated including an extra pixel (e.g. a fullscreen editor would be (width + 1) by (height + 1) )
In opposite to that, Blender 2.5 window/editor code were fixed to have the exact width,height size.
So although the BGE canvas code was still the same as 2.49 it was producing a wrong result.

I'm also adding some commentaries in the setViewport code. BGE is setting the viewports 1 pixel larger.
the setViewport command is been used as if one should pass (minx, miny, width, height), while it should be (minx, miny, maxx, maxy). I will take care of that later, if any one has extra comments on that, please let me know.
2010-04-11 01:53:21 +00:00
Campbell Barton
70540fca3b bugfix [#21230] set-scene animation updates not working
fix for empty scenes with SETLOOPER macro.
2010-04-02 13:43:56 +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
Dalai Felinto
77f55d9cb3 BGE API DOC: a guide on how to build epydoc for windows
We have already a .sh file to build epydocs from Linux, so why not to have it in Windows as well ;) I think that this guide can help people interested in help with the API documentation to test their work.

I'm actually already in touch with at least one volunteer helping with PhysicsConstraints module. VideoTexture may not be a one man job though, for I hope this document can also help.
2010-03-30 06:37:44 +00:00
Dalai Felinto
5089663962 BGE PyDoc: fix for KX_Object not linked to the class in some actuators API page 2010-03-30 04:59:24 +00:00
Benoit Bolsee
03c81862c4 BGE patch [#21019]: Python function for Scene suspend/resume. 2010-03-28 20:50:20 +00:00
Benoit Bolsee
41425c1aa4 VideoTexture: more PyDoc. 2010-03-28 20:15:45 +00:00
Benoit Bolsee
9792d39ab4 VideoTexture: clean previous commit. 2010-03-28 20:12:28 +00:00
Benoit Bolsee
982886d34e BGE: repair armature animation. Was broken since commit 27766. 2010-03-28 20:08:16 +00:00
Benoit Bolsee
a99d584008 VideoTexture: fix video capture lagging when CPU is busy. This problem was caused by special frame handling that was appropriate for video streaming but not for video capture: drift compensation and no frame skipping. Disable that for video capture to take into account the realtime nature of video. 2010-03-28 17:50:45 +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
Dalai Felinto
3925f58b6a BGE: fix for [#21180] - missing min and max values in the API + mode fix (interval wasn't working)
of course it wasn't only a matter of adding the properties in the api :)

The code of validValueForIntervalProperty and modeChange are the same BUT in the future they shouldn't be, for I think it's fine to keep them as separated functions.

Bonus fix: Also we are now checking if the new mode is interval and update the range expression.
2010-03-26 07:21:48 +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
Benoit Bolsee
2ae418e0a8 Fix compilation error in MinGW with my last commit. 2010-03-25 08:48:31 +00:00
Benoit Bolsee
f1cfb5f13c BGE: bug #21684 fixed: multiple material with static modifier now supported with display list. 2010-03-24 22:55:45 +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
Dalai Felinto
15bd165ca0 BGE: bindId property in VideoTexture.Texture (to get the openGL id of the texture)
Now if you have a VideoTexture.Texture you can use its id and draw it with bgl
The Id is only going to be valid if the obj you are getting the VideoTexture.Texture from has a valid texture. In the examples you will see them as planes, that become invisible at load time, but are needed to validate the texture id.

This is a simple example file:
http://blenderecia.orgfree.com/blender/bind_id_simple.blend

And a (much) more advanced one:
http://blenderecia.orgfree.com/blender/bind_id.blend
(get also this image and save it to the same folder of your blend file - http://blenderecia.orgfree.com/blender/mask.png )

Benoit, I couldn't decide on better names so for now I'm glad with this one.
2010-03-20 00:11:25 +00:00
Joshua Leung
1cf95d2494 Keying Set Fixes:
* 'Export Keying Set' operator works again - a change in the previous commit broke the created code
* Relative Keying Sets don't get their paths shown 
* Keying Set paths show options for inserting keyframes too now

---

Another attempt at fixing compile troubles, and removed some commented out + obsolete stuff.
2010-03-16 10:18:19 +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
Benoit Bolsee
50b13f0a56 BGE 2D Filters: slightly change dfelinto patch to use SCA_IScene instead of KX_Scene. It is rather anecdotic since KX_Scene is the only implementation of SCA_IScene but it's better to keep GameLogic and Ketsji separated. 2010-03-06 21:22:09 +00:00
Dalai Felinto
790d6ca256 small png include adjustments (ifndef NOPNG ...).
* gameplayer is now probably not going to build without PNG turned ON.

To fix that it would be necessary to use #ifndef NOPNG  around the GPC_Canvas::MakeScreenShot.
Since I don't this function it's working in 2.5 yet it's better to wait for that before doing it.
2010-03-03 19:34:17 +00:00
Dalai Felinto
c5231858d4 fix for CMake compile in windows. ($PNG_INC was needed) - partial revert of commit 27251 2010-03-03 19:18:50 +00:00
Campbell Barton
f09efddcda fix for minor errors/warnings 2010-03-03 13:59:57 +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
Benoit Bolsee
71f7e50451 VideoTexture: optional arguments to ImageBuff constructor.
ImageBuff([width,height[,color[,scale]]])

width, height: size of buffer in pixel.
               default: buffer not allocated.
color: initial value of RGB channels. Alpha channel is 255.
       Possible values: 0(black=default) -> 255 (white)
scale: True or False to enable or disable fast scaling
       default: False

This constructors eliminates the need to use the load function
when you just want to initialize the image buffer to black or white.
2010-02-26 22:14:31 +00:00
Campbell Barton
9352c9f0c1 use negate_v3 rather then multiplying a vector by -1.0 (no functional changes) 2010-02-26 09:02:52 +00:00
Benoit Bolsee
af987c12b5 VideoTexture: fix a bug with AV sync that was causing a loss of sync in case of rewind to the begining of the file. 2010-02-25 22:12:16 +00:00
Dalai Felinto
4d3accd0cb BGE Dome: BlenderPlayer Console arguments: warpdata working now (only with absolute path)
I forgot to say in the last commit that those arguments are only for the BlenderPlayer.
we can now set external warpdata files.

2Do:
(1) convert relative to absolute paths for warpdata files
(2) investigate weird bug on lack of light in blenderplayer with warpmesh

... [old 2Do]

(3) documentation
(4) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
2010-02-25 06:05:56 +00:00
Dalai Felinto
47d79b04d1 BGE Dome: Console arguments: angle, tilt, mode and warpdata (not working yet)
2Do:
(1) open external warpdata file
(2) documentation
(3) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
otherwise it's a nightmare to update all your files every time you change your projection system. See note.
Maybe SYS_WriteCommandLineInt/Float/String can be used for that. Gotta investigate further.

* Note: an external warpdata file is a must ! Currently every time you need to calibrate your system you have to update the warp file in all your demo files. This is terrible. I'm glad I *now* have a dome near by to test it ;)
* FYI: A recent 'Yo Frankie in a dome' video if you want to see how it works: http://www.vimeo.com/9629626 I'm going to record a better one tomorrow.
2010-02-24 23:01:49 +00:00