Commit Graph

682 Commits

Author SHA1 Message Date
Mitchell Stokes
62963525ce Fix for "[#29911] Crash on reading BL_ActionActuator.channelNames"
The crash occurred when an action actuator was attached to a non-armature object because objects that aren't armatures do not have pose data. A NotImplementedError is now raised if someone tries to access any of the following with an action actuator attached to a non-armature object:

BL_ActionActuator.channelNames
BL_ActionActuator.getChannel()
BL_ActionActuator.setChannel()
2012-01-22 23:15:35 +00:00
Campbell Barton
ae771e742b change filepath limit from 240 to 1024 2012-01-21 14:54:53 +00:00
Campbell Barton
fb4ad50cee use defines for property name lenghths in the BGE, were using 31,32,64,100. 2012-01-16 05:27:11 +00:00
Campbell Barton
a3d1e35d5e de-duplicate object conversion code in BGE 2012-01-12 09:02:29 +00:00
Dalai Felinto
782f0b6382 bge camera actuator: -X and -Y axis
The camera actuator only allows to look the object from its front face.

Given that Blender takes -Y as the default forward orientation, the current
functionality doesn't let a camera to track an actor from behind.

This patch allows for -X and -Y axis tracking. This way a camera over the
shoulders of a character is possible (without resorting to rotate the
mesh/armature original orientation.

- patch reviewed by Campbell Barton, thanks
2012-01-11 07:27:39 +00:00
Campbell Barton
890c97ca40 more edits to r43145,
- remove redundant check in new prop operator which is covered by operators poll func.
- use get_ob_property to get the object prop in BL_ConvertTextProperty() rather then looping for it.
2012-01-05 06:34:14 +00:00
Dalai Felinto
be025ea319 This patch creates an interface for ["Text"] properties in Font objects.
Interface:
http://www.pasteall.org/pic/show.php?id=23785

Simple test file:
http://www.pasteall.org/blend/10616
(I'll commit this to the text suite later)

Code Explanation:
---------------
(1) it adds a toggle to add/remove a "Text" gameproperty.
 - internally this property is just another game property (so we can find it within the game.properties lookup).
 - the property itself has no 'value', the interface shows the content of ob.data.body instead (why? because gameproperties are per object, while the text is per data).

(2) at BGE converter time it sets the current value of the object.data.body to the ["Text"] property.

(3) if you change object.text (bge text property) it automatically convert ["Text"] to a CStringValue.

*** that means if the original property was a CIntegerValue, it will be converted to CStringValue forever ***

* the only to do I can think of is to add a warning at doversion time if user has ["Text"] property for a Font object *
* when that happens we print a warning in console/popup.*
2012-01-04 21:40:00 +00:00
Campbell Barton
6d965f4493 style edits for function declarations 2011-12-30 07:55:15 +00:00
Guillermo S. Romero
2f90cfd423 SVN maintenance. 2011-12-21 20:32:29 +00:00
Dalai Felinto
32b23b9f74 Cucumber, first batch of merge - UI changes and custom exit key
---------------------------------------------------------------
This was a test drive to see how painful the merge will be.
Next batches are:
- use desktop option for fullscreen
- multisampling option
- bullet collision mask
- python
- storage (vbo, dl, ...)
- lighting

[lighting still needs review]
[python could use review, although it should be straightforward]
[storage should be tested more I think]


Merged /branches/soc-2011-cucumber:r
36991,37059,37157,37416,37497-37499,37501,37522,39036,40593

36991:
==UI==
* Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps)
* Created a panel for the embedded player
* Renamed the FPS option for the standalone player to Refresh Rate
* Moved framing options to display
* Made a button to launch the blender player from within blender (only tested on windows for now)

37059:
==UI==
* Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come.
* Removed the physics settings from the scene panel for the BGE.
* Added an Add menu in the logic brick header.

37157:
Making the bake options available in Blender Game

37416:
Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting)

37497:
Some more work on getting the exit key to work in the Blenderplayer.
Input is now restricted to keyboard events only for the exit key UI.
37498:
Some clean up from the last commit.
The exit key setting affects the Blenderplayer now.
37499:
Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter.
37501:
Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API.

[37517: committed previously]

37522:
Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine.
Added setExitKey and getExitKey to the python API

39036:
A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set.
[not committed entirely, see below]]

40552: space_logic.py (* fixed an error in space_logic.py *)

40593:
launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me



########################################################
code left behind (to be included in next commit):
########################################################
		{
			/* Initialize default values for collision masks */
			Object *ob;
			for(ob=main->object.first; ob; ob=ob->id.next)
				ob->col_group = ob->col_mask = 1;
		}
2011-12-20 03:11:56 +00:00
Brecht Van Lommel
3311164b24 Math lib: matrix multiplication order fix for two functions that were
inconsistent with similar functions & math notation:

mul_m4_m4m4(R, B, A) => mult_m4_m4m4(R, A, B)
mul_m3_m3m4(R, B, A) => mult_m3_m3m4(R, A, B)

For branch maintainers, it should be relatively simple to fix things manually,
it's also possible run this script after merging to do automatic replacement:
http://www.pasteall.org/27459/python
2011-12-16 19:53:12 +00:00
Campbell Barton
40a2c1a292 more vertex weight edits,
* replace inline loops with api calls.
* change constraints so verts with 0.0 weight are ignored like they are everywhere else.
2011-12-14 22:54:38 +00:00
Campbell Barton
f025b7b511 went over all uses of MDeformWeight.def_nr and made sure the value is clamped when used as an array index. 2011-12-09 08:20:27 +00:00
Brecht Van Lommel
f426a74c65 Fix #27696: record animation in game engine not working with pre made fcurves. 2011-11-29 18:37:10 +00:00
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
Mitchell Stokes
f94614d791 BGE Animations: Getting the Action Actuator to behave better with pulse mode (on the sensor) and continuous enabled. 2011-11-23 23:29:36 +00:00
Dalai Felinto
59077feff1 BGE patch:[#29372] Matrix size for bge.types.BL_ArmatureBone.bone_mat by Damien Touraine (touraine) 2011-11-23 23:02:38 +00:00
Campbell Barton
e84c0980a3 correct indentation and some whitespace edits (no functional changes) 2011-11-11 13:09:14 +00:00
Campbell Barton
85540d5aa7 more macro --> BLI math lib, mainly replace VECCOPY in render and blenkernel. 2011-11-06 16:38:21 +00:00
Campbell Barton
ec3b0c6a96 misc macro --> bli math lib functions 2011-11-06 15:17:43 +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
b0adf37ef9 - view bounds (now split from collision bounds) was still being used for bge physics in one place, comparison was incorrectly treating it as a flag too.
- cleanup Object struct - remove pad and unused flags, convert some shot's to char's, saving 24 bytes.
2011-11-05 02:30:25 +00:00
Sergey Sharybin
77934cfaed Fix #28865: Draw_bounds_type does not display Polyhedron or Capsule types
Separate DNA properties for bounding box used for bounding box display
in 3d viewport and bounding box used for collision detection in game engine.

Bumped subversion for proper updating old files to new system, but it
need more complex testing.
2011-11-04 15:53:34 +00:00
Sergey Sharybin
4ea816837d Configurable sensor size:
- Added support of variable size sensor width and height.
- Added presets for most common cameras, also new presets can be defined by user.
- Added option to control which dimension (vertical or horizontal) of sensor
  size defines FOV. Old behavior of automatic FOV calculation is also kept.
- Renderer, viewport, game engine and collada importer/exporter should
  deal fine with this changes. Other exporters would be updated soon.
2011-11-04 14:36:06 +00:00
Campbell Barton
665f602f15 python string conversion
- use _PyUnicode_AsStringAndSize where possible
- use %R for PyErr_Format(...) rather then running repr on the object explicitly 
- use const char
2011-11-03 14:09:18 +00:00
Campbell Barton
0d63bb005f replace VECCOPY and QUATCOPY with inline funcs. 2011-10-28 12:40:15 +00:00
Campbell Barton
699030ceb6 use const for readonly strings and set some functions to static 2011-10-27 14:41:26 +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
61389bba41 fix spelling mistakes in comments (and in some python error messages), nothing to effect translations. 2011-10-17 06:39:13 +00:00
Campbell Barton
0c0259d931 fix [#28909] OpenCollada export / import sintel lite v2.1 crashes on import. 2011-10-14 02:31:04 +00:00
Campbell Barton
d893ac690c rename confusing constants (no functional change)
- OB_BOUND_POLYT --> OB_BOUND_CONVEX_HULL
- OB_BOUND_POLYH --> OB_BOUND_TRIANGLE_MESH
2011-10-13 22:14:41 +00:00
Campbell Barton
f0cd9f987d - for some reason navmesh wasnt drawing when VBO was enabled.
- fix navmesh crash (may well have been from own changes)
- changing VBO's now redraws all windows - useful for checking if VBO draws differently.
2011-10-10 02:56:26 +00:00
Campbell Barton
c27926896f spaces -> tabs (whitespace only changes) 2011-10-06 22:04:01 +00:00
Campbell Barton
274b9c8fb8 whitespace cleanup 2011-09-25 12:31:21 +00:00
Mitchell Stokes
58a74bc87f BGE Animations: Fixing various Action Actuator compatibility issues reported by Dalai in issue #28723. 2011-09-25 07:03:20 +00:00
Campbell Barton
4b449aefea remove support for irix 2011-09-21 08:40:30 +00:00
Dalai Felinto
b263aefb0e TexFace to Material Settings big patch
Summary:
========
The idea here is to move the texface options into the material panel.
For images with the change please visit:
http://code.blender.org/index.php/2011/09/bge-material-texface-changes

1 - Some of the legacy problems 2.49 and 2.5x has with the texface system:
==========================================================================
1.1) Shadow, Bilboard and Halo are mutual exclusive (in the code), yet you can
select a face to be more than one mode.
1.2) Sort only works for blend Alpha yet it's an option regardless of the
Transparency Blend you pick.
1.3) Shared doesn't affect anything in BGE.
1.4) ObColor only works for Text objects (old bitmap texts) when using Texture
Face Materials. (not address yet, I so far ignored obcolor)

2 - Notes:
============
2.1) Now "Use Face Textures" in material Option panel will work in Multitexture
even if there is no texture channel.

2.2) In FaceTexture mode it will use TexFace all the time, even if you don't
check the "Use Texture Face" option in the UI. It's a matter of decision, since
the code for either way is there. I decided by the solution that makes the
creation of a material fast - in this mode the user doesn't need to mess with
textures or this "Use Texture Face" option at all. I'm not strong in my opinion
here. But I think if we don't have this then what is the point of the Texture
Face mode?

2.3) I kept references for tface only when we need the image, UV or the tiling
setting. It should help later when/if we split the Image and UV layers from the
tface struct  (Campbell and Brecht proposal).

3 - Changes in a Nutshell:
==========================
3.1) "Texture Face" panel (in the Mesh/Object Data panel) no longer exists. Those settings are all part of the material properties, visible when Game Render is set.

3.2) "Texture Face" Shading mode (in the Render panel) is now called “Single Texture”, it needs a material for special settings (e.g. Billboard, Alpha Sort, …).

3.3) New options in the Material Panel
* Shadeless option in the Material panel is now supported for all three Shading modes.
* Physics is now toggleable, this is the old Collision option.
* Two Side (on) is now called Back Culling (off).
* Alpha Sort is one of the Alpha options, together (and mutually exclusive) to Alpha Blend, Alpha Clip, Add and Opaque (i.e. solid).
* Shadow, Billboard and Halo are grouped in the “Face Orientation” property.
* "Face Textures" and "Face Textures Alpha" (under Options) can be used for all but GLSL shading mode (to be supported in GLSL eventually).
* The backend in the game engine is still the same as before. The only changes are in the interface and in the way you need to think your materials. The bottomline is: It’s no longer possible to share materials between faces that do not share the same game properties.

4 - Acknowledgment:
==================
Mike Pan for the design discussions, and testing along the whole development process.
Vitor Balbio for the first hands-on code with the interface changes. That helped me a lot to push me into work on that.
Benoit Bolsee and Brecht van Lommel for patch review (* no one reviewed the whole patch, or the latest iteractions, so I still hold liability for any problems).
Blender artists that gave feedback and helped testing the patch.

Patch review and original documentation can be found here:
http://wiki.blender.org/index.php/User:Dfelinto/TexFace
http://codereview.appspot.com/4289041/
2011-09-19 19:55:59 +00:00
Campbell Barton
862aababb3 - remove deprecated pose channel members
- change short -> char for flags that support it.
- add pose 'temp' pointer to use for outliner drawing (was using 'prev' and restoring which seems dodjy)
2011-09-16 02:42:50 +00:00
Campbell Barton
9a1f3c587e - fix for mesh_get_mapped_verts_nors copying short normals to floats without scaling.
- BL_SkinDeformer also did this though for that case its not a problem because the normals are later accumulated anyway.
2011-09-12 04:29:35 +00:00
Benoit Bolsee
c1c4743696 svn merge -r 39975:40061 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-09 12:21:41 +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
Joerg Mueller
813d09cb59 BGE fix: ignore sounds that cannot be opened instead of crashing. ;-) 2011-09-06 21:02:26 +00:00
Campbell Barton
0991bed413 fix some complier warnings and add -Wundef to CMake's default GCC warnings. 2011-09-05 23:40:52 +00:00
Mitchell Stokes
103b06d4df BGE animations: fixing initialization order issues for BL_ActionActuator and BL_ArmatureObject. Thanks to z0r for pointing them out and providing a fix. 2011-09-04 01:42:47 +00:00
Mitchell Stokes
70e3541f3a BGE animations: Fixing a potential crash when using camera IPOs. The IPOs were being created off of blendercamera->adt->action when they should have been using the supplied action. Thanks to z0r for pointing out the problem and a potential fix. 2011-09-04 01:27:16 +00:00
Mitchell Stokes
8295480bbe BGE animations: Fixing a crash that would happen if the property for a property mode action actuator was invalid. 2011-09-03 19:33:07 +00:00
Campbell Barton
0cd5dce245 whitespace edits 2011-09-03 02:15:49 +00:00
Mitchell Stokes
99d5fa70de BGE animations: This is an attempt to help smooth out some more compatibility issues with the new action actuator. It now has a similar pulse behavior to the old actuator. This has worked well in most of my tests, but YoFrankie still has problems, and it appears to have gotten a little worse. 2011-09-01 21:47:46 +00:00
Campbell Barton
2365c64014 whitespace bge edits 2011-09-01 02:12:53 +00:00
Campbell Barton
471c005137 typo fix: end of lines ;; --> ; 2011-08-31 01:07:55 +00:00