* all mathutils types now have optional callbacks
* PyRNA returns mathutils quat and euler types automatically when they have the rotation subtype.
* PyRNA, reuse the BPy_StructRNA PyObject rather name making a new one for each function returned.
* use more arithb.c functions for Mathutils quaternion type (less inline cruft).
* BGE Mathutils integration mostly finished- KX_PyMath now converts to Mathutils types rather then lists.
* make all mathutils types share the same header so they can share a number of functions - dealloc, getWrapped, getOwner.
Any 3x3 or 4x4 rna matrix will automatically be returned as a Mathutils matrix.
This makes useful stuff like multiplying a vector location by an object matrix possible.
ob = bpy.data.scenes[0].objects[0]
print (ob.data.verts[0].co * ob.matrix)
Also added mathutils matrix types to the BGE GameObject.localOrientation, worldOrientation
* MT_Matrix3x3 added getValue3x3 and setValue3x3, assumed a 4x3 float array.
* KX_GameObject.cpp convenience functions NodeSetGlobalOrientation, NodeGetLocalOrientation, NodeGetLocalScaling, NodeGetLocalPosition.
* 2.5 python api now initializes modules BGL, Mathutils and Geometry
* modules py3 PyModuleDef's use PyModuleDef_HEAD_INIT, rather then {}, was making msvc fail to build.
* added macros for Vector_ReadCallback, Vector_WriteCallback etc. to check if the callback pointer is set before calling the function.
in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed.
* RNA vector's return Mathutils vector types.
* BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia.
* Comment USE_MATHUTILS define to disable returning vectors.
Example...
* 2.49... *
loc = gameOb.worldPosition
loc[1] = 0
gameOb.worldPosition = loc
* With vectors... *
gameOb.worldPosition[1] = 0
* But this wont crash... *
loc = gameOb.worldPosition
gameOb.endObject()
loc[1] = 0 # will raise an error that the objects removed.
This breaks games which assume return values are lists.
Will add this to eulers, matrix and quaternion types later.
* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
* Update cmake and makefiles to link python generic.
* Fix game engine building for cmake and makefiles.
* Fix compile error with py 3.x, due to 2.x compat fix.
* Mathutils, Geometry, BGL, Mostly working, some //XXX comments for things to fix with py3
python import override (bpy_internal_import.c) so you can import python internal scripts from the BGE and running blender normally.
* Removed modules Expression and CValue, neither were ever available.
* Added GameLogic.EvalExpression(exp) from the Expression module, evaluates an expression like the expression controller (not sure if this is really that useful since python is far more advanced).
* resetting the original blend file path didint work (own fault == -> =)
* Py3.x PyModule_Create didnt allow importing since it didn't add to sys.modules,
Looks like they want us to use init-tab array, but this doesn't suit us since
it needs to be setup before python is initialized.
* Documented GameLogic.globalDict
* pressing P starts the BGE in the 3D view
* redraw window clipping isnt right
* BGE python api works in py3k (without __import__ override or Mathutils, BGL, Geometry)
* no events yet (so there is no way to exit)
* Missing changes to release/windows/installer
* Sequencer fixes in source/blender/src/seqaudio.c dont apply to 2.5
* brechts fix for #18855 r20763 wasnt merged, does this apply to 2.5?
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD
Notes:
* Game and sequencer RNA, and sequencer header are now out of date
a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
not needed anymore.
* Fix "duplicate strip" always increase the user count for ipo.
* IPO pinning on sequencer strips was lost during Undo.
- fix for [#18867] getScreenRay error
... the Vector wasn't been added to KX_Camera origin. Therefore the Ray was always casted to the wrong coordinate when camera wasn't in [0,0,0] (where is obviously was in my tests :)
- making the input parameter compatible with Blender/BGE window coordinate system (Top-Bottom).
... that will break scripts done in 2.49. Since this feature was added only in 2.49 that fix is OK. (and the fix is ridiculous.
Note:
the input parameter is normalized. That means it runs from 0.0 to 1.0. Some users found it confusing, but it allows to make a game compatible with multiple desktop resolutions.a
- CValue warning ShowDeprecationWarning("val = ob.attr", "val = ob['attr']"); had false positives because of python using getattr() internally. Only show the wanring now when a CValue is found.
- Py functions that accepted a vector and a GameObject were slowed down by PySequence_Check() first called on the GameObject, though this would fail it would try and get attributes from the game object - ending up in ~8 attribute lookups each time. Avoiding PySequence_Check() makes ob.getDistanceTo(otherOb) over twice as fast.
- Joystick hat events could crash the BGE for joysticks with more then 4 hats.
- PLY Import failed on PLY files from Carve, added some extra types.
the original blendfile path wasn't reset when loading new blendfiles.
blenderplayer was ok, but running the BGE from blender would set the blendfile original path and never reset it on loading other blend files.
GameEngine sys.path creation was broken because of a pesky slash at the end of each path name.
Win32 sys.paths were also failing when running a game that switched between blend files in different directories
On win32 for some reason making absolute paths from lib->name failed, work around this by using lib->filename.
STR_String.h, cast to float to quiet compiler warnings.
so where foo is an int prop,
gameOb.get("foo") == 0, would end up returning a CValue int proxy.
This is more a problem for KX_GameObject since ListValues with python access mostly don't contain ints, strings, floats.
This also wont break games from 2.48 since the .get() function wasn't available.
importing "pygame" failed when running the BGE for the second time.
Rather then clearing modules, backup and restore them (as its doing with sys.path)
This way the BGE will never remember any modules imported during game play (which can cause bugs/crashes), but it also wont break pythons state by possibly removing modules that are being used internally.
- Deprecation warnings for using attribute access
- Added dictionary functions to KX_GameObject and ListValue
ob.get(key, default=None)
ob.has_key(key)
ob.has_key is important since there was no way to do something like hasattr(ob, "attr") which can be replaced by ob.has_key("attr") - (both still work of course).
ob.get is just useful in many cases where you want a property if it exists but can fallback to a default.
- CListValue::FindValue was adding a reference but the ~3 places it was used were releasing the reference. added a FindValue that accepts a const char* type to avoid converting python strings to STR_String.
- Removed/Commented some unused vars
- CValue::GetPropertyText() could return a temp reference to a variable on the stack, option wasnt used anywhere so removed.
- KX_ConstraintWrapper::GetConstraintId allows args but ignored them
- KX_ConstraintWrapper::PySetParam didnt return NULL on an error (messing up pythons exceptions).
- BLI_natstrcmp didnt return 0 when the while loop exited
For this actuator to be useful it needs to use the first opened blendfile as the base name for the configuration file.
A recent fix that made the gp_GamePythonPath always match the current loaded blend file made this actuator work differently.
keep the original filename to use for making the config name so you can load the config between loading blendfiles.
- Typo in occlusion variable init "m_buffer == NULL;" -> "m_buffer = NULL;"
CcdPhysicsEnvironment.cpp and CcdPhysicsController.cpp had too many warnings, fixed most of them.
+ fixed Python method, PyArg_ParseTuple already checks for errors, no returning of NULL, thanks Campbell too)
+ added linear/angular spring for each of the 6DOFs of a generic 6dof constraint. This makes the generic 6dof constraint very versatile.
allow to dynamically create rigid body constraints while disable collision detection between connected bodies, pass as 10th argument the flag 128
PhysiPython KX_ConstraintWrapper, setParam
export setParam(paramIndex,paramValue0,paramValue1) for Physics constraints
paramIndex 0,1,2 are linear limits, 3,4,5 are angular limits, 6,7,8 are linear motors, 9,10,11 are angular motors
For example:
disableConnectedBodies=128
cons = PhysicsConstraints.createConstraint(oid,rid,generic6dof,pivotInAx,pivotInAy,pivotInAz,angleX,angleY,angleZ,disableConnectedBodies)
#params 0,1,2 are linear limits, low,high value. if low > high then disable limit
cons.setParam(0,0,0)
I will provide an example .blend for Blender 2.49
http://blenderartists.org/forum/showpost.php?p=1382653&postcount=102
(todo: expose this setting in World setting GUI)
Expose contact processing threshold in Advanced GUI, next to rigid body margin, called CPT.
Default to 1, makes rigid body stacking a bit more stable, smaller values makes sliding easier (at the cost of easier jittering).
Disabled for 'dynamic' objects that don't rotate, because characters etc. always need smooth sliding.
SCA_RandomActuator: The random generator was shared between replicas and not deleted. Added ref counting between replicas to allow deletion at the end.
KX_Camera: The scenegraph node was not deleted for temporary cameras (ImageMirror and shadow), causing 500 bytes leak per frame and per shadow light.
KX_GameActuator: Global dictionary buffer was not deleted after saving.
KX_MotionState: The motion state for compound child was not deleted
KX_ReplaceMeshActuator: The mesh was unnecessarily converted for each actuator and not deleted, causing large memleak.
After these fix, YoFrankie runs without memleak.