Commit Graph

1334 Commits

Author SHA1 Message Date
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
Dalai Felinto
77d79ffb5d BGE: removing remaining reference to sce->world->gravity/physics/... (it's all in sce->gm now) + Dome UI changes
UI changes: splitting dome options for different dome modes (eg angle doesn't work for envmap mode)
if anyone wants to tweak that, feel free to do it.

* I put a remaining to bring setEyeSeparation + Focal Length to the Stereo GUI. I'm still not sure what would be the default parameters for that, and that will require other changes (eg remove the flag m_setfocallength and m_seteyesep). For so far only a label remind :)
2009-08-07 03:06:32 +00:00
Campbell Barton
64ba7c1303 fix for writing to freed memory in cases where python wasn't holding a reference to the PyObject 2009-08-04 22:59:50 +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
de36dd1e99 svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22099:22130 2009-08-02 03:59:00 +00:00
Campbell Barton
e60138117c - Ancient resource leak (rev 2) where checkPackedFile would open a file and never close it.
- Running simulations missed freeing some variables.
2009-08-01 06:27:40 +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
0949d48d25 missed this line in last commit 2009-07-31 23:15:00 +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
Brecht Van Lommel
eb80ce4d7f 2.5: Materials
* Diffuse/specular ramps works again.
* Wire is now a material type next to Surface and Halo.
* Removed Volume material type option until it is actually there.
* Some button layout tweaks.
2009-07-25 21:31:17 +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
1c00eacca2 fix memleak in BGE py api - action.channelNames 2009-07-25 20:51:45 +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
Benoit Bolsee
90dfb61e04 BGE: Fix Keyboard actuator that didn't generate release event. 2009-07-25 12:35:14 +00:00
Brecht Van Lommel
1ee8038e41 2.5: Top Menu
* Clean up File menu, added back recover last session op.
* .blend compress now behaves a bit different, previously
  it would only respect the user preference. Now it saves
  existing files the same way they are saved, and new files
  following the user preference. The save operator has a
  Compress toggle in the file browser left panels now.

* Add menu working again, some fixes to make these operators
  work outside the 3d view were needed.
* Timeline menu removed, its contents will be moved to the
  timeline header menus.
* Game menu can now start game, changed the start game op
  to choose another 3d view if none is available.
* Render menu has a few items now.
* Help menu contains a few links again.
2009-07-23 21:35:11 +00:00
Dalai Felinto
01b787636b fix for recent stereo changes+tweaks
(it's the 3rd commit in a row. But as they say, the 3rd is always a charm ;)

I still think we have a little mess with the DEFINE parameters in BGE (as in RAS_IRasterizer::StereoMode).
We used to have them duplicated and hardcoded in 2.4xx, but I think we can do it in another way now.

(I didn't change gameplayer, but I can do it once we have it linking and building properly)
2009-07-20 22:36:56 +00:00
Dalai Felinto
9a9d118bbf BGE panels: wip
Logic Panel:
- world settings (moved from world)
 ... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
 ... separated stereom into stereoflag and stereomode
- properties
 ... (didn't touch it)

Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
 ... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
 ... a datablock link to the materials of an object + the dynamic physic variables

* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
2009-07-20 20:28:29 +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
Ton Roosendaal
bb1f24ac44 2.5
Make include to make GE compile.

Py 2.3 doesnt compile expressions/Value.cpp btw... 
Value.cpp:616: error: 'class PyObjectPlus' has no member named 'ob_type'

Probably need to wait for py 3.1 :)
2009-06-28 18:09:19 +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
7271f86be5 removed un-needed hack, something weired was going on when debugging that made the pointers to these functions change after initialization. 2009-06-28 02:47:49 +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
aa933d2c9f BGE Redraw problem:
at the moment only files from blender 2.4x will display in 2.5x, compared area and window structs in both cases and dont see any differences.

This doesnt fix the problem but corrects a few things related to window drawing with the BGE,
also adds a hack because I noticed the window and area pointers in the KX_BlenderCanvas were offset after initialized, maybe need to use <static cast> ?
2009-06-27 23:54:20 +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
Ton Roosendaal
61e7734aaf 2.5
Game engine Makefile update.

Note to coders: including BLO_ for only intptr typedef is ehh... not
so nice. But it should not have been added there in first place.
(BLO_ = .blend file read/write). Nice for a future cleanup. :)

Also goes for ED_ includes btw, = bad level call for GE! If you need
it to get things work now, fine, but it will make player impossible.
2009-06-23 16:57: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
Dalai Felinto
320fc51a2b BGE pyAPI update
(adding "when accessing it from the Game Engine use Mathutils instead of Blender.Mathutils" message in Blender pyAPI doc)
2009-06-21 17:40:56 +00:00
Campbell Barton
6a35c7fc98 more corrections from cleanup :/ 2009-06-21 17:03:17 +00:00