Commit Graph

1666 Commits

Author SHA1 Message Date
Campbell Barton
a9f79ee536 Quiet compiler warnings. 2010-10-20 12:33:00 +00:00
Nathan Letwory
a293f76cdf Use DEBUG instead of NDEBUG 2010-10-18 06:52:10 +00:00
Campbell Barton
4d37cf90b9 remove G.sce, use G.main->name instead.
Both stored the filename of the blend file, but G.sce stored the last opened file.
This will make blender act differently in some cases since a relative path to the last opened file will no longer resolve (which is correct IMHO since that file isnt open and the path might not even be valid anymore).

Tested linking with durian files and rendering to relative paths when no files is loaded however we may need to have some operators give an error if they are used on the default startup.blend.
2010-10-18 06:41:16 +00:00
Campbell Barton
30b79ddcc6 - fixed remaining unused warnings.
- omit render code from this warning (cmake only), until render branch is merged.
- moved -Wunused-parameter warning to apply to all C code in blender (not just ./source/blender), (cmake only).
2010-10-17 06:38:56 +00:00
Nathan Letwory
53ced0be29 Now sound init param removal revert should be fine (apparently my cmake project files missed rebuild hint for these, fortunately SCons did its job well). 2010-10-16 15:00:04 +00:00
Campbell Barton
8268a4be71 most unused arg warnings corrected.
- removed deprecated bitmap arg from IMB_allocImBuf (plugins will need updating).
- mostly tagged UNUSED() since some of these functions look like they may need to have the arguments used later.
2010-10-16 14:32:17 +00:00
Campbell Barton
1807beabf5 - UNUSED macro wasn't throwing an error with GCC if a var become used.
- made interface, windowmanager, readfile build without unused warnings.
- re-arranged CMake's source/blender build order so less changed libs are build later, eg: IK, avi
2010-10-16 02:40:31 +00:00
Luca Bonavita
996efebbe3 == python api doc ==
First commit to make some structure in doc/ directory.

- moved source/blender/python/doc -> doc/python_api
- moved source/gameengine/PyDoc/*.rst -> doc/python_api/rst
- modified accordingly sphinx_doc_gen.py and sphinx_doc_gen.sh
  (later on I'll try alternative/ scripts by neXyon as promised :)
- source/gameengine/PyDoc/ is still there because contains epydoc stuff for the bge, will ask more and look into it later
2010-10-13 10:42:33 +00:00
Dalai Felinto
3a369128b4 BGE Bugfix for [#22371] Alpha Planes affecting 2DFilters
disabling GL_Blend at the 2dfilter drawing routine makes the trick here. there is not a clear function invoked before the 2dfilter drawing routine. Therefore I found better to disable alpha blending while we are setting the other OpenGl attributes/matrixes.

We are not re-enabling GL_BLEND after we disable it. We could and it wouldn't hurt but I can't see why to. open to suggestions here of course.
2010-10-11 20:55:05 +00:00
Dalai Felinto
682740e7aa make file update for recent bge.render.makeScreenshot commit 2010-10-11 18:47:28 +00:00
Dalai Felinto
4814ffa07b BGE object.life - gives you the life countdown for temporary objects.
Whenever using AddObject actuator, this feature gives you control over morbid events (a.k.a. trigger events before the object ends).

Demo file here:  
http://blenderecia.orgfree.com/blender/tmp/cube_life.blend

Feature implemented as part of the BGE development workshop in BlenderPRO 2010 - Fortaleza, Brazil
2010-10-11 10:47:20 +00:00
Campbell Barton
a20843bf34 building without python works again for the BGE 2010-10-10 20:59:30 +00:00
Campbell Barton
f49fc58df6 enable building the game engine without bullet for scons & cmake 2010-10-10 07:01:56 +00:00
Dalai Felinto
6b8ca3ccdf patch [#24178] bge.render.makeScreeshot - with help from Campbell(ideasman42)
This patch brings back the old functionality from Blender 2.49.
However we are forcing the format to be PNG only (as we had previously on blenderplayer).

Note: If letterboxing is on, we are recording only the camera area of the canvas (cool hein?).
Note2: I have a feeling that this is faster than what we had in 2.49 (which was really slow imo). Maybe it could be even faster if we disable PNG compression. Maybe an option for the future.

* patch finalized and committed as part of the BlenderPRO 2010 - BGE development workshop :) *
2010-10-09 13:46:34 +00:00
Campbell Barton
bd00aa9727 patch [#23781] Dynamically Load Actions
from Mitchell Stokes (moguri)
2010-10-09 10:45:25 +00:00
Mitchell Stokes
f7fb4e70b3 Fixing a memory leak with SCA_PythonKeyboard and SCA_PythonMouse. 2010-10-09 01:31:20 +00:00
Nathan Letwory
663ce490e0 Enable CXX_GUARDEDALLOC support through SCons. 2010-10-08 20:39:56 +00:00
Mitchell Stokes
02d97e4da2 Campbell requested that I remove one of the bge.events.RETKEY aliases, so I'm removing bge.events.RETURNKEY. 2010-10-06 00:36:12 +00:00
Mitchell Stokes
0c7dce887c Updating the bge.types docs to note which KX_GameObject attributes return mathutils objects. Also adding localLinearVelocity, worldLinearVelocity, localAngularVelocity, and worldAngularVelocity to the KX_GameObject docs. 2010-10-05 19:05:09 +00:00
Mitchell Stokes
3cf2d2fd4e A bit of bge.events work:
* A few places in the bge.events docs mentioned bge.keys, when it should have been bge.events
  * Created two aliases to bge.events.RETKEY: ENTERKEY and RETURNKEY
  * ENTERKEY and RETURNKEY have been added to the docs and RETKEY marked as deprecated
  * Added an example of using bge.logic.keyboard to the bge.events docs
2010-10-05 05:44:15 +00:00
Campbell Barton
ab8aa13b82 bugfix [#24087] Blender can not install add-ons unless running with root priviledges
now addon path is created using the same path functions and selecting where to save the startup.blend

also made some minor changes to path handling funcs.
2010-10-03 20:00:22 +00:00
Guillermo S. Romero
fbe1b518f0 Fix attribution, as noticed by Dalai Felinto. 2010-10-03 16:39:07 +00:00
Mitchell Stokes
bcf6726b0b Making the docs for bge.types.KX_SCA_AddObjectActuator.instantAddObject() more clear. Thanks to delaney for pointing this out. 2010-10-03 01:32:01 +00:00
Brecht Van Lommel
8cb17690f1 Fix #23785: in the game engine, if an object had an armature modifier + another
modifier, it would apply the armature deformation twice.
2010-10-02 16:42:12 +00:00
Campbell Barton
90665eb107 use constant rather then sqrt(2.0) 2010-09-30 07:06:00 +00:00
Nathan Letwory
ab5b95d148 * Update BGE for change in r32001
* Fix var declaration in bpy_interface.c
* Remove forward declarations from py_capi_utils.h: they are unnecessary and break compiles (there were probably many warnings about this during compile with GCC).
2010-09-18 19:38:27 +00:00
Brecht Van Lommel
39113a3582 Fix #23857: game engine world colors were not color corrected yet,
giving inconsistent results with render/UI.
2010-09-16 19:03:01 +00:00
Campbell Barton
9b518710c6 update for MingW/CMake
- ignore MSVC warnings when FREE_WINDOWS is defined to quiet warnings.
- the CMake flags were not being set correctly making blender have weirdo colors (no -funsigned-char).
2010-09-15 16:13:32 +00:00
Dalai Felinto
ee7a2ccb22 BGE Dome: fix for "objects parented to the camera will be rendered multiple times in Dome mode"
The funny thing is: I only spotted this bug in March of this year. Almost one year after the original release. I think I don't parent objects to the camera often.

In terms of code I think that I can even think in a more elegant solution. I don't really need to rotate the camera, but simply to calculate its Modelview Matrix.
"""
m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), 1.0);
cam->SetModelviewMatrix(viewmat);
"""
The reason why I originally was rotating the camera was to make sure the frustum calculation was using the right camera frustum. For the frustum it takes the camera modelviewmatrix so the rotation really shouldn't be necessary. Leaving as it's for the time being.

* Note: the bug was never officially reported
2010-09-15 07:05:55 +00:00
Dalai Felinto
46f25680aa blenderplayer fix for "offset" problem when in fullscreen mode (worked together with Nathan Letwory - jesterKing)
The FullScreen state was never set. Therefore the window boundary was returning the wrong dimensions (it was assuming that it was not fullscreen).

* Note: blender.exe -W has a similar problem. We are working on that ...

Tested in Windows only. If someone can test in Linux and OSX please let me know if it's good there as well. To test it: ./blenderplayer -f myfile.blend
2010-09-14 08:19:42 +00:00
Dalai Felinto
898e7857f4 blenderplayer parsing code (better) fix
After last commit I realized that we have a different behavior when running blenderplayer or a runtime. Reason being is that when running blenderplayer the filename is mandatory. While in runtime mode it has no use for it (it can still be passed, but it makes no difference).

I also updated the -h (help) message to be multiplataform and to pass the filename argument only when in blenderplayer mode.

If someone wants to have fun it would be nice to port the blender new parsing code to the gameplayer.
* note: how come "noaudio" is used in the examples but it's not in the options list? *ouch*
I'm leaving as it's in case noaudio get implemented ...
2010-09-13 08:30:56 +00:00
Dalai Felinto
9153e82d21 blenderplayer commandline argument fixes (for -f and -w)
argc always include the filename, therefore all the optional parameters should check for < argc instead of <=argc.

E.g. That was causing "blenderplayer -f 800 600 myfile.blend" to play in a wrong  Bpp (since it was trying to parse the filename to fullScreenBpp).

Bug introduced on rev. 16448 (in 2.49) and merged to 2.5 in rev. 19323
2010-09-13 04:52:20 +00:00
Dalai Felinto
3a2fc4d6dc BGE module reshuffling - VideoTexture -> bge.texture
this was the one module left to be renamed.

We didn't get to any conclusion in the mailing list, but Campbell suggested texture and I think its a good name. We can change any time before next Beta, but for now I think it's handy to have something.

The original proposal is from May:
http://lists.blender.org/pipermail/bf-committers/2010-May/027587.html
2010-09-11 19:38:11 +00:00
Campbell Barton
2406ebe1a4 - added back zlib include (needed for win32).
- use list append in more places.
- remove non existing include dir.
2010-09-07 01:13:10 +00:00
Guillermo S. Romero
a8269c8946 SVN maintenance. 2010-09-03 03:30:20 +00:00
Mitchell Stokes
57e0d677c6 Committing patch [#23489] add method getEventStatus() to PythonKeyboard and PythonMouse by Geoff Gollmer (gomer)
This patch makes SCA_PythonKeyboard.events and SCA_PythonMouse.events return a dictionary of all inputs (including inactive) instead of a list of active inputs.

Example usage:
import bge

if bge.logic.keyboard.events[bge.events.SPACEBAR] = bge.logic.KX_INPUT_JUST_ACTIVATED:
  print("Spacebar pressed!")

A couple of changes to the patch:
  * Wrap python stuff in #ifndef DISABLE_PYTHON
  * Clear and decref m_event_dict in the destructors

A couple of things not related to the patch:
  * Made member variables private
  * Removed a commented out (and no longer used) method (SCA_PythonMouse.show())
2010-08-30 00:18:50 +00:00
Nathan Letwory
6c113b54b3 Finally change SConscript tabs to spaces. 2010-08-29 20:52:05 +00:00
Benoit Bolsee
ad70072009 BGE patch #22623 applied: new bound type: Capsule. 2010-08-28 20:56:54 +00:00
Mitchell Stokes
b1302c3c04 After talking with Campbell, we came to the conclusion that it was probably best not to auto-import modules. To this end, I'm removing the automatic import of the bge module. 2010-08-28 08:00:37 +00:00
Mitchell Stokes
5c23537daa Committing patch [#23278] (by me)
This patch allows a user to pass binary data to LibLoad() to load a blend file from memory instead of a file path. I don't know how useful this will be for others, but I've used it so far for:
  * Decrypting .blend files and loading them without having to store the .blend on the hard drive
  * Pulling .blend data out of an archive and loading it (again skipping the hard drive)

So, it seems the biggest use for this is skipping a bit of file IO (and possibly some security problems).

Example usage:
import bge

with f as open('myfile.blend', 'rb'):
    data = f.read()

bge.logic.LibLoad('Name', 'Scene', data)
2010-08-28 02:07:55 +00:00
Campbell Barton
c20bb3ec43 own rna naming commits r31439 r31472 also renamed BGE vars unintentionally 2010-08-26 23:49:46 +00:00
Benoit Bolsee
80a01e8f2a Fix BGE bug reported by Gilberto: BL_AmartureObject.channels returns only one channel. Fix BL_ArmatureChannel.joint_rotation now that bPoseChannel structure is passed directly to the get function. 2010-08-25 09:25:11 +00:00
Benoit Bolsee
972c6d86f0 BGE bug #23213: VBO preference make object with modifiers crash the BGE. Fix by disabling VBO inside the BGE, it brings no advantage anyway. 2010-08-23 20:53:02 +00:00
Campbell Barton
4f5f868a52 rna data path names which are more likely to break animations.
Added an operator "Update Animation Data",
access from the search menu to update drivers and fcurves.
2010-08-20 06:09:58 +00:00
Campbell Barton
55ed0f0507 more rna renaming. 2010-08-18 08:26:18 +00:00
Joerg Mueller
26809f38aa Audaspace: This should fix all missing python includes now once for all... 2010-08-16 20:05:59 +00:00
Joerg Mueller
a3837b617b Audaspace: Fixing quaternion and relativeness of 3D sounds error. 2010-08-16 14:55:45 +00:00
Joerg Mueller
0be08725ad Py API (GSoC): Second merging commit
Rough summary of fixes/changes:
- Blender Py API: GameLogic -> bge.logic
- Blender Py API: Implemented missing KX_PYATTRIBUTE_TODOs and -DUMMYs.
- Fix for [#22924] KX_PolygonMaterial.diffuse does not return expected list[r,g,b]
- Py API: Renaming _owner attribute of mathutils classes to owner.
- Fix some minor errors in mathutils and blf.
- Enabling game engine autoplay again based on a patch by Dalai:
  * The biggest 3D view in the open scene is used, if there is none, blender opens the file normally and raises an error.
  * The 3D view are is made fullscreen.
  * Quad view, header, properties and toolbox panel are all hidden to get the maximum view.
  * If the game engine full screen setting is set, the game starts in fullscreen.
- Fix for ipo conversion on file transition in the game engine.
2010-08-16 12:14:09 +00:00
Joerg Mueller
25fec1592e Audaspace (GSoC): First merging commit
* All audaspace changes from the GSoC branch including the aud Python module
* This commit also includes some minor changes in source/gameengine/Ketsji/KX_PythonInit.cpp:
  - Fixing names of some constants
  - removing outdated stopDSP() python function
  - Autoinclusion of bge instead of GameLogic
  - Fix for some error messages: GameLogic -> bge.logic
2010-08-16 11:41:07 +00:00
Joerg Mueller
2b7a774ab0 svn merge -r 31314:31370 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2010-08-16 09:37:08 +00:00