Commit Graph

258 Commits

Author SHA1 Message Date
Campbell Barton
3b9b6051d9 rename mathutils constructors to match other parts of the bpy/api (no functional changes) 2011-11-24 04:45:36 +00:00
Campbell Barton
4c17f8e5de PyUnicode_From_STR_String utility function which passes STR_String to PyUnicode_FromStringAndSize (saves a call to strlen).
Also made CValue::ConvertKeysToPython use faster list creation and improved some of the macro formatting.
2011-11-06 01:39:36 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Campbell Barton
6778f7ae05 clear some warnings. 2011-10-09 04:11:18 +00:00
Mitchell Stokes
2636be0ac0 BGE Animations: Fixing some refcount issues with KX_Scene::m_animatedlist (fixes m_animatedlist crashes) and some whitespace issues with KX_GameObject::GetActionManager(). 2011-09-16 20:08:05 +00:00
Benoit Bolsee
dbd6658d73 svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-07 15:34:04 +00:00
Mitchell Stokes
1f8291f78d BGE animations: Adding a separate list to KX_Scene for animated objects. This makes scenes with a lot of non-animated objects faster. In my test scene with 8000 static, non-animated cubes my time spent on animations went from 1.5~1.7ms to 0.001ms. 2011-09-03 20:48:47 +00:00
Campbell Barton
0cd5dce245 whitespace edits 2011-09-03 02:15:49 +00:00
Campbell Barton
2365c64014 whitespace bge edits 2011-09-01 02:12:53 +00:00
Mitchell Stokes
812d5d2e5c BGE Animations: The return type for KX_GameObject.getActionFrame() was an integer when it should have been a float. I've fixed this and converted the tabs in the new BGE animation docs to space. I have also added more info on return types for KX_GameObject.getActionFrame() and KX_GameObject.isPlayingAction(). 2011-08-31 22:32:14 +00:00
Joerg Mueller
43ab8e8624 * Merge trunk up to r39790.
* Subversion bump (also for init_userdef_do_versions).
* Minor fix for compilation without ffmpeg.
2011-08-30 08:22:03 +00:00
Campbell Barton
974a06823e bge py api XK_GameObject.linVelocityMin was returning linVelocityMax. 2011-08-27 01:37:47 +00:00
Mitchell Stokes
9b5c0f65aa BGE Animations: Increasing the max layer count to 8 as per a user request. Also, layer checks were checking for values between 0 and MAX_ACTION_LAYERS when they should have been checking for values between 0 and MAX_ACTION_LAYERS - 1. 2011-08-16 19:59:08 +00:00
Mitchell Stokes
8883702f8a BGE Animations: Various compatibility fixes:
* Blendin for Loop End works even after a negative pulse. Flipper could still use some work in this area.
  * Continuous works a lot better.
  * BL_Action::SetFrame() should work a little smoother.
2011-08-08 04:28:30 +00:00
Mitchell Stokes
387439390d BGE Animations: Fixing some warnings from GCC about initialization order. 2011-07-29 21:58:31 +00:00
Mitchell Stokes
c9c51776ee BGE Animations: Some updates to the Python api:
* Adding methods KX_GameObject.stopAction() and KX_GameObject.isPlayingAction().
  * Made all layer arguments optional. This means I had to change setActionFrame(layer, frame) to setActionFrame(frame, layer=0). This seems a little backwards to me, but I guess that's what you get with optional arguments. Also, this will break existing scripts.
  * Made sure to check user supplied layer values on all action methods. Previously this was only done for playAction().
  * Fixed a few newline issues.
2011-07-16 05:25:15 +00:00
Joerg Mueller
d9cf985730 Merging trunk up to r38329. 2011-07-12 13:09:22 +00:00
Campbell Barton
7370ba1839 fix for NULL pointer usages 2011-07-09 19:59:32 +00:00
Mitchell Stokes
eb55fd1b17 BGE Animations: Fixing a typo: fram -> frame 2011-07-05 22:33:01 +00:00
Mitchell Stokes
ceabc6d119 BGE Animations: Various fixes and bits of cleanup to get the action actuator to behave more like it did in trunk. The Pepper version is still more sensitive to pulses than the trunk version, but this is more accurate. I might try to address this, but I'm not sure. 2011-07-05 05:22:02 +00:00
Mitchell Stokes
5f4f75c51a BGE Animations: Adding in layer weights to allow for layer blending. 2011-07-03 01:59:17 +00:00
Mitchell Stokes
d122f24c1a BGE Animations: Fixing a bug with priority and non continuous animations. 2011-06-29 01:53:17 +00:00
Mitchell Stokes
12ca476b8b BGE Animations: For KX_GameObject.setActionFrame(layer, frame), frame should be a float, not a short. 2011-06-23 23:18:53 +00:00
Mitchell Stokes
ea47125f16 BGE Animations: Exposing KX_GameObject's GetActionFrame() and SetActionFrame() to Python. KX_GameObject.setActionFrame() seems to still have some issues, which I suspect to be a timing thing. I may need to find a better way to set the local time. 2011-06-23 22:44:24 +00:00
Mitchell Stokes
f1a2d46aa0 BGE Animations: Adding the concept of priority back. Priority is handled on a per layer basis. 2011-06-23 22:12:49 +00:00
Mitchell Stokes
c02006bc2b BGE Animations: Adding the ipo flag options to the action actuator. This still needs more testing. 2011-06-16 01:18:52 +00:00
Mitchell Stokes
e67edaf6ac BGE Animations: KX_GameObjects now only instantiate a BL_ActionManger if they need one. 2011-06-11 00:22:35 +00:00
Mitchell Stokes
c431863312 BGE Animations:
* Adding BL_Action::Play() and BL_Action::Stop()
  * Making BL_ActonManger reuse BL_Actions instead of recreating them all the time
  * Making the Property play type work for the Action actuator.
2011-06-11 00:14:47 +00:00
Mitchell Stokes
39bbf3854a BGE Animations: Reimplemented the continuous function of the action actuator.
* To do this, I've added Get/SetFrame() functions.
  * I've also cleaned up a little bit of the wrap around logic in BL_Action.cpp.
2011-06-01 07:42:40 +00:00
Mitchell Stokes
54a37ba855 BGE Animations: Adding more functions to BL_ActionManager and KX_GameObject:
BL_ActionManager:
    * IsActionDone(short layer) - Checks to see if the animation on the given layer has finished.

  KX_GameObject:
    * PlayAction(...) - Adds an action to the object's action manager
    * StopAction(short layer) - Remove an action from the object's action manager
    * IsActionDone(short layer) - Check if an action has finished playing
2011-06-01 05:46:19 +00:00
Mitchell Stokes
07dca94476 BGE Animation:
* Adding IPOs to BL_Action
  * Adding a "speed" option to adjust the playback speed by some factor
2011-05-28 07:15:27 +00:00
Mitchell Stokes
017fa2c19f BGE Animations:
* Adding a BL_Action and a BL_ActionManager
  * Each KX_GameObject has a BL_ActionManager, which can control up to for BL_Action objects at a given time
  * Currently, the only interface to BL_ActionManager is through KX_GameObject via Python
  * Only armature animations are currently supported
2011-05-24 07:52:29 +00:00
Nick Samarin
a918040902 synched with trunk at revision 36569 2011-05-16 20:30:59 +00:00
Brecht Van Lommel
cb12337363 Code cleanup: remove source/kernel module, this wasn't really the kernel of
anything, only contained a hash map and functions to pass command line args
to the game engine. Moved those to container and BlenderRoutines modules.
2011-05-06 20:18:42 +00:00
Campbell Barton
33b8d53224 minor cleanup & replace inline armature separate pchan searches with BLI_findstring(), no functional changes. 2011-04-20 02:56:51 +00:00
Campbell Barton
57436f3013 fix for own error made r35267. 2011-03-03 08:01:11 +00:00
Campbell Barton
7348a50d79 change return values from mathutils callbacks to match pythons (-1 is error), so error macro's can be used in both. 2011-02-28 18:42:41 +00:00
Campbell Barton
f73c993b16 - use Py_CLEAR for python internally referencing other PyObjects (supposed to be safer).
- detect includes for qtcreator projects as well as the ones from cmake (it didnt return all of the right paths).
2011-02-27 04:01:58 +00:00
Nathan Letwory
bb6e7faf72 doxygen: gameengine/Ketsji tagged. 2011-02-25 13:35:59 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
Nick Samarin
c5f6a01dd5 synched with trunk at revision 34793 2011-02-16 17:07:18 +00:00
Dalai Felinto
0890b80ed9 Patch:[#25163] BGE support for Blender Font objects - unicode support
Problem/Bug:
------------
There were no way to have proper unicode characters (e.g. Japanese) in Blender Game Engine. Now we can :)
You can see a sample here: http://blog.mikepan.com/multi-language-support-in-blender/

Functionality Explanation:
--------------------------
This patch converts the Blender Font Objects to a new BGE type: KX_FontObject
This object inherits KX_GameObject.cpp and has the following properties:
- text (the text of the object)
- size (taken from the Blender object, usually is 1.0)
- resolution (1.0 by default, maybe not really needed, but at least for debugging/the time being it's nice to have) 

The way we deal with linked objects is different than Blender. In Blender the text and size are a property of the Text databock. Therefore linked objects necessarily share the same text (and size, although the size of the object datablock affects that too). In BGE they are stored and accessed per object. Without that it would be problematic to have addObject adding texts that don't share the same data.

Known problems/limitations/ToDo:
--------------------------------
1) support for packed font and the <builtin>
2) figure why some fonts are displayed in a different size in 3DView/BGE (BLF)
3) investigate some glitches I see some times
4) support for multiline
5) support for more Blender Font Object options (text aligment, text boxes, ...)

[1] Diego (bdiego) evantually will help on that. For the time being we are using the "default" (ui) font to replace the <builtin>.
[2] but not all of them. I need to cross check who is calculating the size/dpi in/correctly - Blender or BLF. (e.g. fonts that work well - MS Gothic)
[3] I think this may be related to the resolution we are drawing the font
[4] It can't/will not be handled inside BFL. So the way I see it is to implement a mini text library/api that works as a middlelayer between the drawing step and BLF. 
    So instead of:
      BLF_draw(fontid, (char *)text, strlen(text));
    We would do:
      MAGIC_ROUTINE_IM_NOT_BLF_draw(fontir, (char *)text, styleflag, width, height);
[5] don't hold your breath ... but if someone wants to have fun in the holidays the (4) and (5) are part of the same problem.

Code Explanation:
-----------------
The patch should be simple to read. They are three may parts:
1) BL_BlenderDataConversion.cpp:: converts the OB_FONT object into a KX_FontObject.cpp and store it in the KX_Scene->m_fonts
2) KetsjiEngine.cpp::RenderFonts:: loop through the texts and call their internal drawing routine.
3) KX_FontObject.cpp::
  a) constructor: load the font of the object, and store other values.
  b) DrawText: calculate the aspect for the given size (sounds hacky but this is how blf works) and call the render routine in RenderTools
4) KX_BlenderGL.cpp (called from rendertools) ::BL_print_game_line:: Draws the text. Using the BLF API

*) In order to handle visibility of the object added with AddObject I'm adding to the m_scene.m_fonts list only the Fonts in a visible layer - unlike Cameras and Lamps where all the objects are added.

Acknowledgements:
----------------
Thanks Benoit for the review and adjustment suggestions.
Thanks Diego for the BFL expertise, patches and support (Latin community ftw)
Thanks my boss for letting me do part of this patch during work time. Good thing we are starting a project in a partnership with a Japanese Foundation and eventual will need unicode in BGE :) for more details on that - www.nereusprogram.org - let's call it the main sponsor of this "bug feature" ;)
2010-12-16 10:25:41 +00:00
Dalai Felinto
70df57df0f BGE BugFix: [#24052] Can't change dynamic object's orientation using python (fix by Benoit)
from the tracker:
"""The required functionality is provided by the localOrientation property: setting this value will change the dynamic object orientation. This is because dynamic object have no parent and thus the local and world orientation are identical. However, setting worldOrientation will only change the scenegraph node, which has no effect as the physics controller will reset the orientation on next physics synchronization."""
2010-12-08 06:59:13 +00:00
Campbell Barton
357826aa6e bugfix [#24967] bge.KX_GameObject.worldAngularVelocity does not work, breaks mathutils somehow
- Exceptions from reading vector values in the game engine where not being caught.
- Also wrote specific KX_GameObject exceptions, without these the errors are quite confusing.
2010-12-06 08:29:41 +00:00
Campbell Barton
0876fce009 rename and negate DISABLE_PYTHON --> WITH_PYTHON 2010-10-31 04:11:39 +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
f49fc58df6 enable building the game engine without bullet for scons & cmake 2010-10-10 07:01:56 +00:00
Nick Samarin
90ab716cd5 synched with trunk at revision 32129 2010-10-03 16:28:28 +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
Nick Samarin
c6ea23c77c synched with trunk at revision 30597 2010-07-21 20:54:53 +00:00