Rotations are now stored internally as radians, while exposing degrees in the UI -
in the graph editor and UI controls. This is done in two areas:
1) Using the unit system to convert RNA data to display as degrees in the UI controls
2) FCurves now use degrees for rotation, so you can edit in the graph editor what
you see in the UI.
All rotation data is consistently accessible in DNA and RNA as radians, degrees are only
used for the UI controls and graph editor.
This commit includes conversions will convert old files (stored data and also fcurve data)
to the new units, hopefully everything should go smoothly!
Part of this also changes a few properties that were hard-coded as degrees before (such
as IK pole angle and brush texture rotation) to also use the same consistent system of
radians (dna/rna) and degrees (ui).
Thanks to Joshua for hints and review here too.
this bug was introduced in Blender 2.49 (probably my own fault, in other part of the code though while fixing support for IPOs in GLSL Lamps).
The good news is: GLSL Lamps looks in BGE like working perfectly now.
Multitexture on the other hand is not supporting "negative" lamps (with the checkbox option on).
From my search (svn blame+log) it looks like multitexture never had negative lamp working. Actually in Blender 2.34 when this was introduced in BGE (maybe in Blender as well?) I couldn't see negative lamps working either. It's hard to test this with Blender 2.34 though (it even crash with my test file).
Now the default eye separation value is 0.10 (reasonable for games with 1 meter == 1 B.U.
The focallength used is the camera focal length (DOF settings). It allow you to even use different focal lengths for different scenes (good for UI)
In order to change it you can change the camera focal length or use Rasterizer.setFocalLength.
If you use the Rasterizer method it will use this value for all the cameras.
ToDo:
- Blenderplayer settings
- Update wiki documentation (any volunteer)?
* Note to stereo fans:
I don't have a real stereo environment to test it (other than cheap cyan-red glasses). If you can give it a try in a more robust system and report bugs or problems with BGE current system please let me know. I would be glad to help to make it work 100% by the time Blender 2.5 is out.
For the record, BGE is using the method known as 'parallel axis asymmetric frustum perspective projection'. This method is well documented here:
http://local.wasp.uwa.edu.au/~pbourke/miscellaneous/stereographics/stereorender/
* utility function BLI_findstring to avoid listbase lookup loops everywhere.
eg:
ListBase *lb= objects= &CTX_data_main(C)->object;
Object *ob= BLI_findstring(lb, name, offsetof(ID, name) + 2);
* made some more math functions use const's, (fix warnings I made in previous commits)
Assignment to KX_GameObject localOrientation and
worldOrientation matrices was assuming row-major matrix
although reading these matrices was returning a column-major
MathUtils object.
The faulty function (PyMatTo) is fixed and all matrices
in python are now assumed column-major.
This function is also used in the following methods:
BL_Shader.setUniformMatrix4()
BL_Shader.setUniformMatrix3()
(No change in scripts if you didn't specify the optional
transpose parameter: the default value is changed so
that column-major matrices are assumed as before.)
KX_Camera.projection_matrix
(assignement to this attribute now requires a column-major
matrix and you must fix your script if you were setting
a value to this attribute.)
Even a static mesh can be used as replacement: the mesh
will be instantiated with the soft body settings of the
object. The position and orientation of the soft body
is preserved after the replacement.
Known limitation: the velocity of the soft body is reset
aftet the replacement. This is because soft body don't
have a well defined velocity.
How it works now:
whenever you have to read/write object names you can do it without the prefix "OB". (it's not hard at all to fix scripts)
How it was before:
It was a mess :)
We had an inconsistent API where sometimes you had to input "OBname" and other "name" directly to assign object as data (usually in actuators).
Justification for the change:
Talking with Campbell we had since a while ago this feeling that this should be changed any time we were going to deprecate the API. So in order to deliver Blender 2.5beta0 with a more close-to-the-final API we decided that today was a good day to implement that.
Remaining issues:
1) VideoTexture uses IM or MA to identify the output material/texture. I haven't touched that, but it does look a bit off. (i.e. I didn't changed any MA, IM naming)
2) I didn't see the code of dynamic mesh. It may need to be edited as well.
This bug was introduced after commit # 24102 (BGE: when letterbox is enabled use the camera framing as a clipping area) reported in IRC by Pete Carss (domejunky)
*) an extra stub fix for recent commit. By the way: we want to have blenderplayer running in blender 2.5 beta0. Therefore if you are doing big changes in the last minutes (Friday, Saturday??) It would help a lot if you could enable blenderplayer in your builds. links problems are really easy to fix)
**) an typo I spotted in recent mesh dynamic load in bge.
from Mitchell Stokes (moguri)
--- from the patch
With f-curves there are 3 rotation modes, rotation_euler, rotation_axis_angle, and rotation_quaternion. The IPO converter
was still simply looking for "rotation" f-curves instead of specific ones. This patch fixes that and also
fixes bug #19873 ( http://projects.blender.org/tracker/index.php?func=detail&aid=19873&group_id=9&atid=306
).
* Convert all code to use new functions.
* Branch maintainers may want to skip this commit, and run this
conversion script instead, if they use a lot of math functions
in new code:
http://www.pasteall.org/9052/python
- rna vars arm.bones.active & rna.edit_bones.active
- needed special undo support.
- readfile.c loads.
- duplicate and copy_armature support.
- keep the draw flag, renamed to BONE_DRAW_ACTIVE, only use for openGL drawing.
Note: it may be better to allow active/unselected as with objects.
Blended shape keys can now be displayed & edited in edit mode. This
is much like showing an armature modifier in edit mode, and shape keys
now are a applied as a virtual modifier (for mesh & lattice only, curve
doesn't fit in the stack well due to tilt).
The main thing missing still is being able to switch between the active
shape key in edit mode, that's more complicated.. but the weights of
other shapes can be edited while in edit mode.
One thing to be careful about is that this does automatic crazyspace
correction, which means that if you edit a shape key with a low value,
the actual vertices will be moved to correct for that and actually move
a (potentially much) longer distance.
Also includes some UI tweaks, mainly placing some buttons horizontally
since the vertical list was getting too long.
Internal change to not apply the shape keys to the Mesh vertex coordinates,
but rather use it as part of the derivedmesh/displist evaluation. This only
has one practical advantage right now, which is that you can now make a
linked duplicate and pin it's shape key to a different shape than the first
object.
Further, this makes shape keys correctly fit into the modifier stack design,
which will help implement some other features later. Also it means the mesh
vertex coordinates are now really the orco's.
* bring back 'player' libtype, after investigation with ideasman.
scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
* further cleaning of 'player' stuff. Now only 3 libs are remaining, of which ideally the stubs lib will be fixed at some point, fading away into the dark history of not-so-nice code. The current blenderplayer part is still a little bit hackish, I'll see if I can find a better alternative, for now it works good enough.
* first working changes to get blenderplayer linking
* blenderplayer/ moved into source/ (CMakeLists.txt changed for that too)
* added externs for bprogname to gp_ghost, so that it links properly
* Add BGE_CXXFLAGS so we can get rid of hard-coded BGE compiler settings. This was only done for windows, but now linuxers and osxers should be able to set BGE-specific optimisation too. See the windows default configs for example.
Previously the only way to detect if the mouse moved over a different object was to enable true-level-triggering and have a python script detect the change.
When the Pulse option is set, focusing on a different object pulses true.
Python attribute is focusSensor.usePulseFocus.
This is similar to the collision sensors pulse option where changes in the set of collision objects generates an event too.
Found this functionality missing when trying to make a logic demo that used mouse-over with overlapping objects.
2.49a tries to remove the object from the conversion list every time. Now remove from the conversion list directly without being apart of the remove object function.