Commit Graph

729 Commits

Author SHA1 Message Date
Brecht Van Lommel
5765b1bfa4 2.5: Update GPU module to deal with removed G_TEXTUREPAINT
global, passing along enable/disable mipmap setting through
various functions instead.
2009-08-16 20:14:49 +00:00
Campbell Barton
9236f92dab - remove UNSET becuase it only works with newer versions of cmake,
- changed the SDL and Freetype vars to match CMake's names
- removed unneeded freetype, SDL and ftgl includes
2009-08-15 13:30:28 +00:00
Ton Roosendaal
d8dc1b9fd4 2.5
Makefiles to get new AUD stuff to compile (OSX 10.3 PPC)
It uses lib/samplerate, which gets committed soon too
2009-08-11 18:14:49 +00:00
Joerg Mueller
2a58c84018 Stop changing the includes! 2009-08-10 19:22:50 +00:00
Joerg Mueller
a27cc1adf0 2.5 audio cleanup:
* Removed CD Actuator
* Removed bSample and bSoundListener
* Removed SoundSystem
* Removed -noaudio parameter
2009-08-10 15:39:11 +00:00
Campbell Barton
7440fee85c remove python2.x support 2009-08-10 00:07:34 +00:00
Joerg Mueller
6c5c58e057 2.5: Sound branch merge!
See mailing list for additional information.
2009-08-09 21:16:39 +00:00
Campbell Barton
bc093b4cc4 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22205:22290 2009-08-07 04:41:15 +00:00
Campbell Barton
e7c53e20a1 gameObject -> blenderObject mapping was being created but wasnt needed.
Added utility func tag_main for (un)tagging every ID in a Main database with LIB_DOIT.
2009-08-07 03:51:28 +00:00
Campbell Barton
9bb8540ba9 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22130:22205 2009-08-04 05:34:21 +00:00
Campbell Barton
856dba000b no need to store the physics env in each KX_GameObject 2009-08-04 05:14:10 +00:00
Campbell Barton
59bfe91f21 remove makefile cruft, mostly BGE related references to SUMO, Fuzzics, Blenkey etc.
also remove define MOZ_NOT_NET that was being used all over for telling the plugin to link against mozilla (not netscape)
2009-08-04 03:13:36 +00:00
Campbell Barton
95e08f6bff * remove unused member of KX_Scene - m_objecttree
* implicit declaration of getenv in glutil.c
2009-08-02 23:53:53 +00:00
Campbell Barton
0b3fd395ef svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22075:22099 2009-07-31 23:42:22 +00:00
Campbell Barton
3eb8000eb4 remove more unneeded args, also allow ipo to animate the ref value for KX_BlenderMaterial's 2009-07-31 09:05:13 +00:00
Campbell Barton
c371f49d9a svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21908:22075 2009-07-31 00:42:10 +00:00
Campbell Barton
7301f33b26 remove some unused function args 2009-07-30 21:42:29 +00:00
Campbell Barton
dd918da8de ReplaceMesh Actuator option to replace the physics mesh and display mesh + python api options.
When the mesh field is left blank and Physics option is enabled, it reinstances the physics mesh from the existing mesh.
like calling gameOb.reinstancePhysicsMesh() from python.
2009-07-26 01:32:37 +00:00
Campbell Barton
777a0d78e7 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r21899:21908 2009-07-25 23:16:45 +00:00
Campbell Barton
e9ca43521f BGE Physics
Add support back for reinstancePhysics mesh, a frequently requested feature in the BGE forums.
from what I can tell Sumo supported this but bullet never did.
Currently only accessible via python at the moment.

- rigid body, dynamic, static types work.
- instanced physics meshes are modified too.
- compound shapes are not supported.

Physics mesh can be re-instanced from...
* shape keys & armature deformations
* subsurf (any other modifiers too)
* RAS_TexVert's (can be modified from python)

Moved the reinstancePhysicsMesh functions from RAS_MeshObject into KX_GameObject since the physics data is stored here.

video and blend file demo.
http://www.graphicall.org/ftp/ideasman42/reinstance.ogv
http://www.graphicall.org/ftp/ideasman42/reinstance_demo.blend
2009-07-25 22:57:29 +00:00
Campbell Barton
1b14243405 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20937:21899
missing commits from peter 20942, 21165, 21170, 21174, 21597
these files still need manual merging

source/blender/makesdna/DNA_sequence_types.h
source/blender/src/sequence.c
source/blender/src/seqeffects.c
source/blender/src/editseq.c
source/blender/include/BSE_sequence.h
2009-07-25 20:59:09 +00:00
Campbell Barton
88097e9909 - BGE Python API converting a mesh from a python arg was broken but happened to work if the uninitialized pointer was not NULL.
- iris.c - looks like a copy/paste error, was using rect where it could not have been initialized.
2009-07-25 19:34:38 +00:00
Campbell Barton
4d0a6fee4a cmake option to disable SDL,
bpy_interface.c - change order of checking scripts to avoid calling stat on .py files.
2009-07-20 10:24:53 +00:00
Nathan Letwory
2e854ec7cf SCons
* ensure all SConscripts are ready for win64-vc (where necessary).
* ensure we have proper _DEBUG flag for Python when we're doing a debug build.
* some cleaning up of linking etc.
* ensure /EHsc is there for game engine modules.
2009-07-16 19:41:28 +00:00
Campbell Barton
a97b645a44 * workaround for PySys_SetArgv() in python3 needing wchar_t
* PyRNA - id_struct.keyframe_insert("path", index, frame)
2009-07-08 09:23:49 +00:00
Campbell Barton
f60760e2e2 Python API
Mathutils support for subclassing Vector, Quat, Euler and Matrix types.

Removed C docstrings, prefer to make sure our epydocs are well maintained rather then duplicate, vague doc strings.
Will convert scripts to detect missing docs from the BGE.
2009-06-30 00:42:17 +00:00
Campbell Barton
9a7ea9664e BGE PyAPI support for subclassing any BGE game type from python, scripters define extra functions on gameObjects.
Adding a UI to set the type on startup can be added easily.

# ----
class myPlayer(GameTypes.KX_GameObject):
  def die(self):
    # ... do stuff ...
    self.endObject()

# make an instance
player = myPlayer(gameOb) # gameOb is made invalid now.
player.die()

# ----

One limitation (which could also be an advantage), is making the subclass instance will return that subclass everywhere, you cant have 2 different subclasses of the same BGE data at once.
2009-06-29 12:06:46 +00:00
Campbell Barton
c50bbe5ae7 BGE Py API using python3 c/api calls. include bpy_compat.h to support py2.x 2009-06-29 02:25:54 +00:00
Campbell Barton
6b9f3b5f5c BGE Python API
Remove the last of the odd C++/python wrapper code from http://www.python.org/doc/PyCPP.html (~1998)

* Use python subclasses rather then having fake subclassing through get/set attributes calling parent types.
* PyObject getset arrays are created while initializing the types, converted from our own attribute arrays. This way python deals with subclasses and we dont have to define getattro or setattro functions for each type.
* GameObjects and Scenes no longer have attribute access to properties. only dictionary style access - ob['prop']
* remove each class's get/set/dir functions.
* remove isA() methods, can use PyObject_TypeCheck() in C and issubclass() in python.
* remove Parents[] array for each C++ class, was only used for isA() and wasnt correct in quite a few cases.
* remove PyTypeObject that was being passed as the last argument to each class (the parent classes too).

TODO -
* Light and VertexProxy need to be converted to using attributes.
* memory for getset arrays is never freed, not that bad since its will only allocates once.
2009-06-28 11:22:26 +00:00
Campbell Barton
388e59a768 BGE Fix for no redrawing.
Was caused by un-initialized engine ticrate, do_versions was working on 2.4x but isnt in 2.5 so just add a zero check when getting from the world.
2009-06-28 02:37:07 +00:00
Campbell Barton
4b914c7f75 Made Mathutils use radians rather then degrees. defining USE_MATHUTILS_DEG for testing existing scripts.
Added conversion for BGE Quaternion WXYZ (Blender/C) -> XYZW (Moto C++).
BGE Python API now uses WXYZ following mathutils (break script warning).
2009-06-25 20:47:41 +00:00
Campbell Barton
d428ba1de8 PyAPI RNA/BGE
* 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.
2009-06-25 10:11:37 +00:00
Ton Roosendaal
af3f862480 2.5
Removing editors/include export from Make, it's not needed luckily :)
2009-06-23 17:06:46 +00:00
Campbell Barton
eb22a7b210 PyRNA API support for matrix types as Mathutils matrix (with callbacks) rather then a generic rna sequence of floats.
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.
2009-06-23 13:34:45 +00:00
Campbell Barton
bce3f7e019 PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then thin wrapping vectors which is crash prone.
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.
2009-06-22 04:26:48 +00:00
Campbell Barton
8ead648fd1 Spring Cleaning
* 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.
2009-06-21 16:18:38 +00:00
Brecht Van Lommel
89d2559e6d 2.5
* 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.
2009-06-18 19:25:58 +00:00
Campbell Barton
7e57823c47 build generic modules in their own lib, compiling without the game engine would fail because bpy_internal_import.c wasnt being included.
(scons only)
2009-06-18 04:36:45 +00:00
Campbell Barton
489db9994d Some generic modules from blender 2.4x building with py3k and mostly working.
* 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.
2009-06-17 20:33:34 +00:00
Campbell Barton
95335af1b9 fix for a bug reported by zapman on blenderartist.
De-activating a loop-end actuator didnt work (it kept looping).
Looked into this further and it turns out that the actuators run with both positive and negative events false, the sound actuator assumes because its not negative that its a positive event and plays the sound anyway.

Fix by checking that its a positive event before playing.

The size limit on the message actuator was 100 which broke some scripts, set to 16384 instead.
2009-06-17 12:32:28 +00:00
Benoit Bolsee
5de1ddf96c BGE bug #18931: YoFrankie bug in 249-trunk (works in 248). 2009-06-17 06:54:35 +00:00
Campbell Barton
a1cf7988c1 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20855:20928
Sequencer changes from source/blender/src coming next
2009-06-16 14:21:58 +00:00
Campbell Barton
0a66e24bd7 KX_PythonSeq (used for a number of BGE sequence types)
* cont.actuators.get("key", default) # dict like get function
* if "key" in cont.sensors: ...

Updated docs
Added missing include to Particle.c
2009-06-16 08:52:04 +00:00
Campbell Barton
2ecbe1c81c BGE Py API
* 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
2009-06-16 07:16:51 +00:00
Campbell Barton
6efd2e6439 saving globalDict didnt work with python3.x 2009-06-15 20:22:50 +00:00
Campbell Barton
611e2f484c GameEngine WIP,
* 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)
2009-06-13 17:25:54 +00:00
Campbell Barton
fa01eef27e svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r20849:20855
to get the BGE building with py3k and no sdl
2009-06-13 14:07:38 +00:00
Campbell Barton
b40eb540d3 G.sipo was being passed in the BGE when it wasnt needed, just access G.sipo directly.
KX_PythonSeq.cpp - disable the cmpfunc with py3, need to have richcmp.
2009-06-13 13:02:01 +00:00
Campbell Barton
eed13b43b1 merged from trunk 20741:20848
* 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?
2009-06-13 11:09:13 +00:00
Campbell Barton
1c2ce9535c use contains for ListValue and KX_GameObject types (has_key is deprecated by python)
eg.
 if 'prop' in gameOb: ...
 if 'GameOb' in sce.objects: ...
2009-06-12 12:56:12 +00:00