Commit Graph

2140 Commits

Author SHA1 Message Date
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
Kent Mein
9dc992a3fd Some small fixes to get things compiling on solaris with cmake.
There are also some changes that need to be done to libmv but I'm 
leaving those out so I can get it patched upstream first.

(Only works with gcc/g++ if we want to use sun's compiler we would need
to get rid of all of our annonymous structs which I don't think
we want to do at this point, example:

typedef struct wmNDOFMotionData {
        union {
                float tvec[3]; // translation
                struct { float tx, ty, tz; };   // this would need to be fixed
		// something like this or something similar:
                struct { float x, y, z; } t;
                };
...
)

Kent
2012-01-12 16:31:27 +00:00
Campbell Barton
a3d1e35d5e de-duplicate object conversion code in BGE 2012-01-12 09:02:29 +00:00
Dalai Felinto
de86d89a9f Cucumber - AA for blenderplayer and fullscreen
..............................................
svn merge ^/branches/soc-2011-cucumber -r 38968,38970,38973,39045,40845

Notes:
======
*  we replaced fullscreen by playerflag in DNA_scene.types.h. So no doversion here, I think this is a small reversion can't see any potential problem in forcuing users to re-check fullscreen. If the file is really old (<250) it will doversion though;

* (for after commit) it would be nice to gray out the width/height when desktop=True

* for a rainy day: it would be nice to have other ghost modes (e.g. screensaver) to support desktop + MSAA as well. It's not a huge deal given that I don't even know if anything else work (apart from windowed, fullscreen and embed) but it doesn't hurt to have it updated as well.

* there is something strange with outliner. I think space_outliner merge-info is not in sync with the ^/ folder. It's probably a wrong merge early in cucumber.

Commit Logs:
===========
# 40845 by dfelinto
remove desktop and fullscreen properties. They are both part of playerflag now
also I removed the fullscreen from the DNA completely. I don't think we need doversion that..

#39045 by kupoman
The Desktop option is now greyed out when fullscreen is not checked rather than disappearing from the UI completely.

#38973 by kupoman
Adding a checkbox to the UI to allow the full screen Blender Player to use the current desktop resolution instead of the resolution setting.

#38970 by kupoman
Multisampling now works in a fullscreen Blender Player.

#38968 by moguri
Committing a patch from Mitchell Stokes (Moguri) to include a setting in the UI for the Blenderplayer multisampling.
2012-01-11 20:53:22 +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
cda5d1769d minor changes to BLF api use
- replace calls to BLF_width & BLF_height --> BLF_width_and_height
- no need to call strlen() on length value passed to BLF_draw(). this already checks for \0 char.
2012-01-11 05:45: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
8d55b7bf0e BGE Font Object: fix for relative path not working AND packed fonts not working
[I don't think anyone has ever reported those, what makes me slightly sad but carry on ;)]

Those fixes introduce a more generic function to load a font before calling BLF_load.
I think it should move to be part of Blender util routines or BLF itself.

For the time being here will make it. Once we get <builtin> font working we go for this.
Thanks Diego Borghetti for the usual assistance with blf.
2012-01-05 06:02:42 +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
Alex Fraser
15dc3d4609 Fixes two crashers for games, with GHOST under SDL:
- Fixes SDL fullscreen mode for game engine (blenderplayer). Mode switching (resolution changes) not supported yet though.
- Fixes embedded game engine exit.
See patch tracker [#29748].
2012-01-02 12:35:06 +00:00
Daniel Stokes
359a95bdc9 Changing KX_FontObject to look for a "Text" game property instead of a "text" property to match with bitmap font usage. 2011-12-31 09:37:19 +00:00
Campbell Barton
424e09a2ce use PyUnicode_From_STR_String in the game engine in more places. 2011-12-30 12:44:16 +00:00
Dalai Felinto
c52f780021 cucumber merge, multiline font object:
revisions: 38384,38387,38403,38404,38407,42997,42998

#42998 by dfelinto
BGE Font Object - fix for offset
(scaling also has to be taken into account here)

#42997 by dfelinto
Font Object Multiline fix.
The offset was totally wrong when object had scale[1] != 1

#38407 by kupoman
Changing the "text" property of a KX_FontObject now changes the text. This allows for control of a FontObject through logic bricks.

#38404 by kupoman
KX_FontObject now supports the x and y offset options.

#38403 by kupoman
KX_FontObject now makes use of the font's line spacing option, and correctly accounts for rotation and font size when applying the spacing.

#38387 by kupoman
The KX_FontObject text attribute is working again.

#38384 by kupoman
Primitive support for the new line character added to KX_FontObjects. The line spacing is fixed, and does not work when the FontObject is rotated. Also, the text attribute has been temporarily disabled, as it needs some updating to support the multiline changes.
2011-12-30 12:28:51 +00:00
Campbell Barton
2c43f99c0a formatting edits, missed these last commit. 2011-12-30 11:49:58 +00:00
Campbell Barton
6d965f4493 style edits for function declarations 2011-12-30 07:55:15 +00:00
Mitchell Stokes
ac498a6b64 Cleaning up the GPU_extensions_init/exit() code a bit to keep the Blenderplayer from crashing on exit and restart. 2011-12-23 07:10:01 +00:00
Campbell Barton
3cce96320e recent matrix row/col swap broke matrix assignment in the BGE, fix provided by Andrew Hale 2011-12-23 00:51:54 +00:00
Campbell Barton
51016c4dea split >120 length lines (mostly if statements) 2011-12-22 00:03:20 +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
Dalai Felinto
bfdaa3b187 bugfix: [#29486] 2D filters make scene disappear when wire material used - patch by Juha Mäki-Kanto
when last drawn material is wire it will not set back to face drawing.
2011-12-17 21:23:02 +00:00
Campbell Barton
ad96dacbc5 style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
2011-12-17 00:52:36 +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
2253b63c97 static functions for getting power of 2 values were being copied about too much, add to the BLI_math api.
- is_power_of_2_i
- power_of_2_min_i
- power_of_2_max_i
2011-12-16 09:25:07 +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
Morten Mikkelsen
82b9e4d16f verify existence of dm 2011-12-10 01:00:12 +00:00
Morten Mikkelsen
965c287630 fixes scale on derivative maps 2011-12-09 23:26:06 +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
Sergey Sharybin
f6f7e270e3 Slight refactor of VBO code to deal with multiple textures.
Added compareDrawSettings callback to driver mesh's callbacks which are
drawing textured faces (mapped and not mapped). This new callback checks
if two faces are drawing with the same settings (testures, shading etc)
and if they not, flush of faces happens into ogl using glDrawArrays and
next face would be drawn with it's own settings.

Currently implemented compareDrawSettings is used to resolve issue from
bug report only, probably there are extra places where this callback is
needed, but haven't seen configuration where current logic will fail,
so it should be ok.

Also reordered arguments passing to drawMappedFaces DM's callbacks,
so now all drawing callback are accepting list of callbacks and then
userData, instead of using mixed order of callbacks and userData which
was a bit confusing to work with.

This commit fixes:
- #26410: VBO & multitexture doesnt work
- #29464: VBO enabled causes UV coruption
2011-12-01 12:12:39 +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
f62ad8f69b remove header text:
"The Blender Foundation also sells licenses for use in proprietary software under the Blender Licens"

also remove NaN references from files that have been added since blender went opensource.
2011-11-29 10:54:47 +00:00
Antony Riakiotakis
57731da05b Add missing GLEW_STATIC definition, causing link errors. 2011-11-26 15:08:01 +00:00
Campbell Barton
6736576f6d replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX 2011-11-26 04:07:38 +00:00
Mitchell Stokes
64008199b9 Merging Blenderplayer modifier fix (U.gameflags |= USER_DISABLE_VBO) from Cucumber. 2011-11-24 21:16:27 +00:00
Dalai Felinto
ddfc518cae BGE patch: [#29285] Video Texture: Avoid slow rescale (non power of 2 support check) by Goran Milovanovic (goran)
"Just a simple check for non power of two support (GLEW_ARB_texture_non_power_of_two), to avoid what seems to be a very slow, and very unnecessary gluScaleImage call."

This is the only part of the VideoTexture that does the POT calculation, so the check seems good.
It would be interesting if some opengl guru would like to benchmark the use of this in other areas of Blender (e.g. 2D Filters, and all GLSL materials).

Note that mipmap should also be supported automatically by this extension, so it's not something to worry about.
2011-11-24 19:27:15 +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
743d2f8c0f rename image type defines to be less ambiguous, also set BMP as not supporting alpha (it reads but cant write) 2011-11-22 00:35:26 +00:00
Campbell Barton
30fd1ab523 replace ImBuf.depth with ImBuf.planes to match ImageFormatData.planes & to avoid confusion with ImageFormatData.depth 2011-11-21 20:47:19 +00:00
Campbell Barton
0e2c8cdcdd move image settings into their own structure so the interface can be shared where image saving settings are needed.
currently file out node and render output share this struct & UI.
2011-11-21 20:19:58 +00:00
Campbell Barton
822d6ae037 - rename MovieTrackingMarker.enabled --> mute, to match constraints/nla/fcurves/sequencer
- report an error if an invalid BGpic arg is given to v3d.background_images.remove()
2011-11-19 02:48:09 +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
62f2218554 macro formatting & remve some unused code. 2011-11-05 05:44:52 +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
Campbell Barton
057bf2a02b misc doc edits
- remove recently added sphinx reference workaround.
- tested doxygen, correct some warnings, set tab width and added pymathutils group.
- added convenience target 'make doc_doxy'
2011-11-05 01:48:10 +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