Commit Graph

295 Commits

Author SHA1 Message Date
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
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
6a35c7fc98 more corrections from cleanup :/ 2009-06-21 17:03:17 +00:00
Daniel Genrich
b6182781b0 Fix for compiler error since BLO_sys_types.h was not in the path 2009-06-18 21:25:21 +00:00
Martin Poirier
2269280910 don't include stdint.h directly, it's broken on non C99 compliant compilers (you know which one I'm talking about). 2009-06-18 20:23:46 +00:00
Campbell Barton
025b6dcbc3 fix for building with py2.3 2009-06-18 17:34:39 +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
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
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
Campbell Barton
5a8b389ebe was printing all warnings twice 2009-06-10 19:33:59 +00:00
Brecht Van Lommel
c8b4cf9206 2.50:
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.
2009-06-08 20:08:19 +00:00
Campbell Barton
903722299d BGE PyAPI fixes
- 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.
2009-06-03 04:12:59 +00:00
Campbell Barton
8e882d0d61 Bug in KX_GameObject.get() and ListValue.get(), wasn't checking if the CValue derived objects could be converted to a PyObject.
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.
2009-05-31 17:44:38 +00:00
Chris Want
74977721a4 BGE build probs with CMake: directory "source/gameengine/SceneGraph"
was been referenced as "source/gameengine/Scenegraph" in some
include paths.
2009-05-26 17:15:29 +00:00
Campbell Barton
33b974ee43 BGE Py API
- 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.
2009-05-26 16:15:40 +00:00
Campbell Barton
e93d1ba8e7 Misc warnings
- 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
2009-05-26 10:44:14 +00:00
Campbell Barton
7ba91ddcc3 BGE Script template for a python module (set EOL to native this time)
BGE PyAPI use defines for error return values
 - del gameOb['var'] error message was wrong.
2009-05-26 07:41:34 +00:00
Campbell Barton
41acd3b81c While testing YoFrankie with the new API attributes found some issues...
- corrections to docs
- disallow calling controller.activate(actuator) when the controller is not active. (Raise a SystemError)
- Added 2 new attributes, CValue.name - deprecates CValue.getName(), KX_GameObject.children deprecated KX_GameObject.getChildren(), (same for getChildrenRecursive()).
2009-05-17 16:30:18 +00:00
Diego Borghetti
0c6ec76a4c Fix Makefiles for gameengine. 2009-05-11 15:34:46 +00:00
Benoit Bolsee
ee1c29028d BGE: Add MT_Vector3 support for Py attribute macro system. See KX_PYATTRIBUTE_VECTOR_... 2009-05-11 12:41:48 +00:00
Campbell Barton
a6721e549d changes to get benoits logic updates building on scons with gcc 2009-05-10 21:22:25 +00:00
Benoit Bolsee
386122ada6 BGE performance, 4th round: logic
This commit extends the technique of dynamic linked list to the logic
system to eliminate as much as possible temporaries, map lookup or 
full scan. The logic engine is now free of memory allocation, which is
an important stability factor. 

The overhead of the logic system is reduced by a factor between 3 and 6
depending on the logic setup. This is the speed-up you can expect on 
a logic setup using simple bricks. Heavy bricks like python controllers
and ray sensors will still take about the same time to execute so the
speed up will be less important.

The core of the logic engine has been much reworked but the functionality
is still the same except for one thing: the priority system on the 
execution of controllers. The exact same remark applies to actuators but
I'll explain for controllers only:

Previously, it was possible, with the "executePriority" attribute to set
a controller to run before any other controllers in the game. Other than
that, the sequential execution of controllers, as defined in Blender was
guaranteed by default.

With the new system, the sequential execution of controllers is still 
guaranteed but only within the controllers of one object. the user can
no longer set a controller to run before any other controllers in the
game. The "executePriority" attribute controls the execution of controllers
within one object. The priority is a small number starting from 0 for the
first controller and incrementing for each controller.

If this missing feature is a must, a special method can be implemented
to set a controller to run before all other controllers.

Other improvements:
- Systematic use of reference in parameter passing to avoid unnecessary data copy
- Use pre increment in iterator instead of post increment to avoid temporary allocation
- Use const char* instead of STR_String whenever possible to avoid temporary allocation
- Fix reference counting bugs (memory leak)
- Fix a crash in certain cases of state switching and object deletion
- Minor speed up in property sensor
- Removal of objects during the game is a lot faster
2009-05-10 20:53:58 +00:00
Campbell Barton
136d4c34ba deprecate controller.getActuator(name) and controller.getSensor(name) for
controller.actuators[name] and controller.sensors[name]

Made a read-only sequence type for logic brick sensors and actuators which can access single items or be used like a list or dictionary.
We could use a python dictionary or CValueList but that would be slower to create.

So you can do...
 for s in controller.sensors: print s

 print controller.sensors["Sensor"]

 print controller.sensors[0]

 sensors = list(controller.sensors)

This sequence type keeps a reference to the proxy it came from and will raise an error on access if the proxy has been removed.
2009-05-10 01:48:14 +00:00
Campbell Barton
df01af5a1f Methods didn't check for zombies which could crash in the case where a method for an object is kept.
func = ob.getMass
 ...remove ob...
 func() # crash

2 More refcount fixes spotted by Benoit too
2009-05-09 18:18:04 +00:00
Campbell Barton
355b585447 More refcount errors spotted by Benoit, one with python getting a list item so scene.objects["OBfoo"] would always mess up refcounts. 2009-05-09 17:24:21 +00:00
Campbell Barton
cdba1ddd5d BGE Python owned proxies had a problem being decref'd twice, this would crash on freeing KX_Vertex/Poly Proxy types when python was compiled with debug options enabled.
add_mesh_torus.py wasnt tested from update, will go through all edited scripts and test :\
2009-05-07 22:06:27 +00:00
Campbell Barton
779bf435ef python3 compatibility for the BGE api, this only works with scons when WITH_BF_NOBLENDER is enabled.
Mathutils, Geometry and BGL modules are currently disabled with python3
2009-05-07 05:23:15 +00:00
Campbell Barton
2f7cd19ff5 print BGE Py api warnings only once to avoid flooding the terminal and slowing the game down too much, resets on loading scenes/blendfiles and restarting the game engine. 2009-05-04 08:55:54 +00:00
Benoit Bolsee
2aa3c932d0 BGE performance: use inline function as much as possible in scenegraph and logic to avoid function call. 2009-05-03 21:51:57 +00:00
Campbell Barton
22b501c791 fixes for bugs submitted by BGE users, fixes by myself and Mitchell Stokes
- when the attribute check function failed it didnt set an error raising a SystemError instead
- Rasterizer.getMaterialMode would never return KX_BLENDER_MULTITEX_MATERIAL
- PropertySensor value attribute checking function was always returning a fail.
- Vertex Self Shadow python script didnt update for meshes with modifiers.
2009-05-03 09:21:58 +00:00
Campbell Barton
41f42099ac BGE Py API patch from Mitchell Stokes, add distance attribute to the radar sensor, dont use 'continue' because its a python keyword.
removed (ssizeobjargproc) it breaks py2.3
2009-05-02 04:53:01 +00:00
Campbell Barton
a625f5e476 error in last commit 2009-04-29 23:59:59 +00:00
Campbell Barton
1e7df58519 python modules in the game engine could point to builtin modules like GameLogic that was cleared.
I added module clearing before there was checks for invalid python objects, so now its not needed for BGE Builtin types at least.

also made the builtin modules get re-used if they already exist and clear all user modules when the game engine finishes so with Module-Py-Controllers the referenced modules are at least up to date when pressing Pkey.
2009-04-29 23:39:27 +00:00
Campbell Barton
81dfdf8374 ifdef's for future py3 support, after this adding py3 can mostly be done with defines or batch renaming funcs (with the exception of CListValue slicing)
.
No changes for py2.x.
2009-04-29 16:54:45 +00:00
Campbell Barton
94c6cadfe2 BGE PyAPI
- renamed generic attribute "isValid" to "invalid" since BL_Shader already uses isValid.
- Moved deprecation warnings from CValue 
- removed unused KX_Scene::SetProjectionMatrix and KX_Scene::GetViewMatrix
- Added KX_Scene attributes "lights", "cameras", "objects_inactive", to allow access to objects in unseen layers (before the AddObject actuator adds them)
- KX_Camera deprecated cam.enableViewport(bool) for cam.isViewport which can be read as well.
2009-04-28 13:11:56 +00:00
Campbell Barton
9c3d628082 [#18616] Scons+MinGW compiling error with gaming engine enabled.
Attempt to fix building in windows with mingw
2009-04-27 07:07:22 +00:00
Campbell Barton
0c482f7607 BGE API - small changes
- print CListValue errors only once.
- bge_api_validate_py.txt now validates modules as well as types.
- added missing functions and consts for epydoc modules. some of these in GameLogic.py still need sorting.
2009-04-24 20:27:04 +00:00
Campbell Barton
6a270ecb94 BGE Python API
CListValue fixes
- Disable changing CValueLists that the BGE uses internally (scene.objects.append(1) would crash when drawing)
- val=clist+list would modify clist in place, now return a new value.
- clist.append([....]), was working like extend.
- clist.append(val) didnt work for most CValue types like KX_GameObjects.

Other changes
- "isValid" was always returning True.
- Set all errors for invalid proxy access to PyExc_SystemError (was using a mix of error types)
- Added PyObjectPlus::InvalidateProxy() to manually invalidate, though if python ever gains access again, it will make a new valid proxy. This is so removing an object from a scene can invalidate the object even if its stored elsewhere in a CValueList for eg.
2009-04-23 00:32:33 +00:00
Benoit Bolsee
f6d27e73ee BGE: some more cleanup, remove useless ReplicaSetName(), move code to ProcessReplica. 2009-04-22 16:58:04 +00:00
Campbell Barton
5553d2c014 BGE C++ API
PyObjectPlus::ProcessReplica() is now called when any of its subclasses are replicated.

This is important because PyObjectPlus::ProcessReplica() NULL's the 'm_proxy' python pointer I added recently.
Without this a replicated subclass of PyObjectPlus could have an invalid pointer (crashing the BGE).

This change also means CValue::AddDataToReplica() can be moved into CValue::ProcessReplica() since ProcessReplica is always called.
2009-04-22 14:42:00 +00:00
Campbell Barton
a8592d09d0 BGE C++ API
Some functions used
	ProcessReplica(replica);
others
	replica->ProcessReplica()

Use the second method everywhere so the PyObjectPlus's ProcessReplica() can be called from its subclasses.

Note that PyObjectPlus's ProcessReplica isnt used yet.
2009-04-22 12:16:41 +00:00
Campbell Barton
785b784e09 BGE Python API
improved how attribute errors are set so each classes py_getattro function dosnt need to set an error if the attribute doesn't exist.
Now py_base_getattro sets an error on a NULL return value when no errors are set to avoid setting errors at multiple levels.
2009-04-22 09:47:57 +00:00
Campbell Barton
720f7a8b69 use PyList_SET_ITEM instead of PyList_SetItem,
PyList_SetItem does error checking and decref's existing values, PyList_SET_ITEM is a macro for direct assignment, only for use on new lists.
2009-04-20 23:27:53 +00:00
Campbell Barton
217bbb7800 BGE Python API
Separate getting a normal attribute and getting __dict__, was having to do too a check for __dict__ on each class (multiple times per getattro call from python) when its not used that often.
2009-04-20 23:17:52 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Campbell Barton
f5fc4ebdd8 BGE Python API
- More verbose error messages.
- BL_Shader wasnt setting error messages on some errors
- FilterNormal depth attribute was checking for float which is bad because scripts often expect ints assigned to float attributes.
- Added a check to PyVecTo for a tuple rather then always using a generic python sequence. On my system this is over 2x faster with an optmized build.
2009-04-19 21:01:12 +00:00
Campbell Barton
6bc162e679 BGE Python API
removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
2009-04-19 17:29:07 +00:00
Benoit Bolsee
fe08da3b4c BGE: fix Pyfrom_id to work on w64. 2009-04-19 17:26:03 +00:00
Campbell Barton
7dbc9dc719 BGE Python API cleanup - no functionality changes
- comments to PyObjectPlus.h
- remove unused/commented junk.
- renamed PyDestructor to py_base_dealloc for consistency
- all the PyTypeObject's were still using the sizeof() their class, can use sizeof(PyObjectPlus_Proxy) now which is smaller too.
2009-04-19 14:57:52 +00:00
Campbell Barton
8d2cb5bea4 BGE Python API
This changes how the BGE classes and Python work together, which hasnt changed since blender went opensource.
The main difference is PyObjectPlus - the base class for most game engine classes, no longer inherit from PyObject, and cannot be cast to a PyObject.

This has the advantage that the BGE does not have to keep 2 reference counts valid for C++ and Python.

Previously C++ classes would never be freed while python held a reference, however this reference could be problematic eg: a GameObject that isnt in a scene anymore should not be used by python, doing so could even crash blender in some cases.

Instead PyObjectPlus has a member "PyObject *m_proxy" which is lazily initialized when python needs it. m_proxy reference counts are managed by python, though it should never be freed while the C++ class exists since it holds a reference to avoid making and freeing it all the time.
When the C++ class is free'd it sets the m_proxy reference to NULL, If python accesses this variable it will raise a RuntimeError, (check the isValid attribute to see if its valid without raising an error).
- This replaces the m_zombie bool and IsZombie() tests added recently.

In python return values that used to be..
 return value->AddRef();
Are now
 return value->GetProxy();
or...
 return value->NewProxy(true); // true means python owns this C++ value which will be deleted when the PyObject is freed
2009-04-19 12:46:39 +00:00
Campbell Barton
92cea7c1b1 KX_MeshProxy "numPolygons" and "numMaterials" attributes were using the "materials" attribute function, error made recently when converting attributes. 2009-04-19 06:48:27 +00:00
Campbell Barton
df8cf26404 Added m_zombie to the base python class (PyObjectPlus), when this is set all the subclasses will raise an error on access to their members.
Other small changes...
- KX_Camera and KX_Light didnt have get/setitem access in their PyType definition.
- CList.from_id() error checking for a long was checking for -1 against an unsigned value (own fault)
- CValue::SpecialRelease was incrementing an int for no reason.
- renamed m_attrlist to m_attr_dict since its a PyDict type.
- removed custom getattro/setattro functions for KX_Scene and KX_GameObject, use py_base_getattro, py_base_setattro for all subclasses of PyObjectPlus.
- lowercase windows.h in VideoBase.cpp for cross compiling.
2009-04-17 20:06:06 +00:00
Campbell Barton
066098dfec this should fix building with mingw 2009-04-12 22:05:09 +00:00
Campbell Barton
332032fb99 BGE Python API
Support for assigning any Type to a KX_GameObject

so you can do...
 gameOb.follow = otherGameOb
 gameOb[otherGameOb] = distanceTo
 gameOb["path"] = [(x,y,x), (x,y,x)]
 del gameOb[mesh]


* types that cannot be converted into CValue types are written into the KX_GameObject dict
* the KX_GameObject dict is only initialized when needed
* Python properties in this dict cannot be accessed by logic bricks
* dir(ob) and ob.getPropertyNames() return items from both CValue and Py dictionary properties.

Also found that CType was converting python lists to CType Lists but very buggy, would crash after printing the list most times.
Use python lists instead since logic bricks dont deal with lists.
2009-04-12 14:22:51 +00:00
Campbell Barton
ee24c829b5 need strtoll defined as _strtoi64 to build on windows 2009-04-12 10:56:36 +00:00
Campbell Barton
5b306b7541 BGE Python API
added defines PY_SET_ATTR_FAIL, PY_SET_ATTR_MISSING and PY_SET_ATTR_SUCCESS

This is useful when objects that have user defined attributes (GameObject and Scene)
When calling setattr on the parent, a return value of PY_SET_ATTR_FAIL means the attribute exists but failed to be set, so don't set the custom attribute.
2009-04-12 09:56:30 +00:00
Campbell Barton
33170295c8 use long long rather then int for storing game logic properties.
There were also some problems with int to python conversion
- assigning a PyLong to a KX_GameObject from python would raise an error
- PyLong were coerced into floats when used with internal CValue arithmetic

Changes...
- PyLong is converted into CIntValue for coercing and assigning from python
- CValue's generic GetNumber() function returns a double rather then a float.
- Print an error when a PyType cant be coerced into a CValue

Tested with python, expressions and property sensor.
2009-04-12 06:41:01 +00:00
Campbell Barton
4cd088b105 BGE Py API
- setting the scene attributes would always add to the scenes custom dictionary.
- new CListValue method from_id(id)

so you can store a Game Objects id and use it to get the game object back.

 ob_id = id(gameOb)
 ...
 gameOb = scene.objects.from_id(ob_id)
 
This is useful because names are not always unique.
2009-04-11 20:58:09 +00:00
Andre Susano Pinto
2fff90bbb4 Added function name to many of the PyArg_ParseTuple calls in gameengine
This way python raises more useful messages.
2009-04-10 16:45:19 +00:00
Campbell Barton
4669fa48a8 Added GameKeys.EventToCharacter(event, is_shift) so you can get the character that would be types when pressing a key.
Last commit was made in the pydocs folder only, so this includes changes mentioned in rev 19620.
2009-04-09 16:00:45 +00:00
Campbell Barton
eacf5b5d6d BGE Text
- multi-line strings for bitmap text 
- keyboard sensor now logs return and pad enter as "\n"

BGE std::vector use in Value.cpp and RAS_MaterialBucket.cpp
The size of a new list is known before making them, reduce re-allocs, though probably not a noticeable speedup.
2009-04-09 09:50:17 +00:00
Campbell Barton
18511c56d3 BGE Python API (small changes)
- Make BGE's ListValue types convert to python lists for printing since the CValue GetText() function didnt work well- printing lists as [,,,,,] for scene objects and mesh materials for eg.
- Check attributes are descriptor types before casting.
- py_getattr_dict use the Type dict rather then Method and Attribute array.
2009-04-07 16:00:32 +00:00
Campbell Barton
5d64dd019e BGE Python API
Use each types dictionary to store attributes PyAttributeDef's so it uses pythons hash lookup (which it was already doing for methods) rather then doing a string lookup on the array each time.

This also means attributes can be found in the type without having to do a dir() on the instance.
2009-04-07 11:06:35 +00:00
Campbell Barton
3dacfbb231 BGE Python API
- action attribute wasnt checking for NULL (own fault)
- KX_Scene getCamera wasnt checking for NULL
- CListValue had asserts for not yet implimented functionality, this would close blender. Better to print an error if the user manages to run this functions (I managed to by CListValue.count([1,2,3]))
2009-04-05 14:55:50 +00:00
Campbell Barton
b6114be5e3 include PyObjectPlus method in __dict__ 2009-04-04 09:54:05 +00:00
Campbell Barton
a35a8f7a38 - should fix compiling with older python versions (<2.5)
- made the isA() function accept python types as well as strings.
- renamed _getattr_dict to py_getattr_dict
2009-04-04 08:20:52 +00:00
Campbell Barton
fd2b115678 Python BGE API
- Initialize python types with PyType_Ready, which adds methods to the type dictionary.
- use Pythons get/setattro (uses a python string for the attribute rather then char*). Using basic C strings seems nice but internally python converts them to python strings and discards them for most functions that accept char arrays.
- Method lookups use the PyTypes dictionary (should be faster then Py_FindMethod)
- Renamed __getattr -> py_base_getattro, _getattr -> py_getattro, __repr -> py_base_repr, py_delattro, py_getattro_self etc.

From here is possible to put all the parent classes methods into each python types dictionary to avoid nested lookups (api has 4 levels of lookups in some places), tested this but its not ready yet.

Simple tests for getting a method within a loop show this to be between 0.5 and 3.2x faster then using Py_FindMethod()
2009-04-03 14:51:06 +00:00
Campbell Barton
d573e9c539 BGE Python api
Added the method into the PyType so python knows about the methods (its supposed to work this way).
This means in the future the api can use PyType_Ready() to store the methods in the types dictionary.
Python3 removes Py_FindMethod and we should not be using it anyway since its not that efficient.
2009-04-03 04:12:20 +00:00
Campbell Barton
b22705f169 BGE Python
- Bugfix for running dir() on all BGE python objects. was not getting the immediate methods and attributes for each class.
- Use attributes for KX_Scene (so they are included with dir())
- Override __dict__ attributes for KX_Scene and KX_GameObject so custom properties are included with a dir()
2009-04-03 02:16:56 +00:00
Campbell Barton
fcc23faa3a Added getitem/setitem access for KX_GameObject
ob.someProp = 10
can now be...
ob["someProp"] = 10

For simple get/set test with an objects 10 properties, this is ~30% faster.

Though I like the attribute access, its slower because it needs to lookup BGE attributes and methods (for parent classes as well as KX_GameObject class).

This could also be an advantage if there are collisions between new attributes added for 2.49 and existing properties a game uses.

Made some other small optimizations,
- Getting and setting property can use const char* as well as STR_String (avoids making new STR_Strings just to do the lookup).
- CValue::SetPropertiesModified() and CValue::SetPropertiesModified(), were looping through all items in the std::map, advancing from the beginning each time.
2009-04-02 05:38:05 +00:00
Campbell Barton
c78b460fce Use Benoits attributes in KX_GameObject.
Deprecated..
getPosition, setPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass

* swapped set/get to get/set in KX_PYATTRIBUTE_RW_FUNCTION macro to match pythons getsetattrs.
* deprecation warnings in the api and notes in epydocs.
* added 'state' attribute
* gameob.mass = 10 # now works because its not checking only for float values.
* dir(gameob) # includes attributes now
2009-03-24 19:37:17 +00:00
Benoit Bolsee
e3d0dfc9eb BGE API cleanup: add support for attribute set/get through functions only. 2009-03-22 21:36:48 +00:00
Brecht Van Lommel
d52400bfbd 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r18677:19317
Notes:
* Sequence transform strip uses G.scene global, this is commented
  out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
  2.5 got merged, but no new files were added. Calls to these files
  are commented out with "XXX etch-a-ton". editarmature.c and
  transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
  (player still fails to link).
2009-03-17 21:44:58 +00:00
Benoit Bolsee
a37cec2802 BGE patch 18368: Modulus (ie %) expression controller in BGE. Implement a cache for the expression for better performance. 2009-03-11 22:11:52 +00:00
Campbell Barton
c785532bec Py BGE API
Python dir(ob) for game types now includes attributes names,
* Use "__dict__" rather then "__methods__" attribute to be Python 3.0 compatible
* Added _getattr_dict() for getting the method and attribute names from a PyObject, rather then building it in the macro.
* Added place holder *::Attribute array, needed for the _getattr_up macro.
2009-02-26 09:04:06 +00:00
Campbell Barton
2eb85c01f3 remove warnings for the BGE
- variables that shadow vers declared earlier
- Py_Fatal print an error to the stderr
- gcc was complaining about the order of initialized vars (for classes)
- const return values for ints and bools didnt do anything.
- braces for ambiguous if  statements
2009-02-25 03:26:02 +00:00
Campbell Barton
5488175d0b BGE Python API
* fixed segfaults in CListValue.index(val) and CListValue.count(val) when the pyTypes could not be converted into a CValue.
* added scene.objects to replace scene.getObjectList()
* added function names to PyArg_ParseTuple() so errors will include the function names 
* removed cases of PyArg_ParseTuple(args,"O",&pyobj) where METH_O ensures a single argument.
* Made PyObjectFrom use ugly python api rather then Py_BuildValue(), approx %40 speedup for functions that return Python vector and matrix types like ob.orientation.
2009-02-23 06:41:10 +00:00
Campbell Barton
570b48aae6 BGE Py API
print filename:line with ShowDeprecationWarning().
Typo in scripttemplate_gamelogic.py
removed 2 unneeded typedefs
2009-02-22 10:22:49 +00:00
Campbell Barton
9d5c2af1d1 * removed typedefs that were not used (from anonymous enums and structs)
* Missed some cases of using a 'char *' as an attribute
* replace BGE's Py_Return macro with Pythons Py_RETURN_NONE
* other minor warnings removed
2009-02-21 12:43:24 +00:00
Benoit Bolsee
d3e7b37fff BGE API Cleanup: distinction between array and list of values in KX_PYATTRIBUTE macros. Fix compilation problem under Windows with strcasecmp: define it as stricmp 2009-02-19 23:13:41 +00:00
Campbell Barton
cdec2b3d15 BGE Python API
Use 'const char *' rather then the C++ 'STR_String' type for the attribute identifier of python attributes.

Each attribute and method access from python was allocating and freeing the string.
A simple test with getting an attribute a loop shows this speeds up attribute lookups a bit over 2x.
2009-02-19 13:42:07 +00:00
Campbell Barton
92d4ef0939 Accept negative indices's for ListValues
scene.getObjectList()[-1] works like a python sequence.

removed some STR_String creation that was only used to do comparisons, in a simple expressions benchmark this made logic use 4% less overall.
2009-02-19 07:01:49 +00:00
Nathan Letwory
c3d74547be SCons:
* giving compileflags, cc_compileflags and cxx_compileflags to BlenderLib() now actually overrides any other setting (so there's no unclarity when ie. conflicting options are being specified in REL_CFLAGS et al). These are set after either release or debug flags, but before any *_WARN flags (so those stay maintained).
* add cxx_compileflags for GE parts on win32-vc to have better performance.
* NOTE: if platform maintainers (OSX and Linux) could check and do the same for their systems. Not vital, but probably very, very much welcomed by GE users.
2009-02-15 23:26:00 +00:00
Brecht Van Lommel
8762737400 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17853:HEAD 2009-01-26 08:34:40 +00:00
Benoit Bolsee
cc569504d0 BGE API Cleanup: update the python attribute definition framework.
* Value clamping to min/max is now supported as an option for integer, float 
  and string attribute (for string clamping=trim to max length)
* Post check function now take PyAttributeDef parameter so that more 
  generic function can be written.
* Definition of SCA_ILogicBrick::CheckProperty() function to check that
  a string attribute contains a valid property name of the parent game object.
* Definition of enum attribute vi KX_PYATTRIBUTE_ENUM... macros. 
  Enum are handled just like integer but to be totally paranoid, the sizeof()
  of the enum member is check at run time to match integer size.
* More bricks updated to use the framework.
2009-01-02 17:43:56 +00:00
Benoit Bolsee
2dfd34994f BGE API cleanup: introduction of a generic framework to link Python attributes to logic brick class member. See KX_PYATTRIBUTE macros in PyObjectPlus.h. 2008-12-31 20:35:20 +00:00
Benoit Bolsee
1c663bbc7e First batch of GE API cleanup.
The principle is to replace most get/set methods of logic bricks by direct property access. 
To make porting of game code easier, the properties have usually the same type and use than
the return values/parameters of the get/set methods. 
More details on http://wiki.blender.org/index.php/GameEngineDev/Python_API_Clean_Up

Old methods are still available but will produce deprecation warnings on the console: 

"<method> is deprecated, use the <property> property instead"

You can avoid these messages by turning on the "Ignore deprecation warnings" option in Game menu.

PyDoc is updated to include the new properties and display a deprecation warning
for the get/set methods that are being deprecated.
2008-12-29 16:36:58 +00:00
Nathan Letwory
0d7027ecab 2.5 / SCons / BGE
* this should bring back BGE with scons building. Tested on scons/msvc, will test scons/gcc in a bit
  NOTE: this is not WITH_BF_PLAYER yet.
2008-12-24 21:33:51 +00:00
Brecht Van Lommel
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
Campbell Barton
3ec4f674d0 Python 2.4 should build with the game engine now, no thanks to python for switching from char to const char 2008-10-02 00:22:28 +00:00
Campbell Barton
f510057fef [#17600] char* -> const char*
Thanks to Sean Bartell (wtachi), was causing many many warnings which distracted from the real problems.
2008-09-20 11:08:35 +00:00
Kent Mein
115cf18bed converted my gen_utils.h fix to PyObjectPlus.h
Also added a fix for PyMarshal_WriteObjectToString

Now I just need to figure out linking of the gameengine on my imac.

Kent
2008-09-06 14:13:31 +00:00
Kent Mein
8675ff6d1d Trying to keep things compiling on my imac (10.4.11)
I'm getting this error now:
GPG_Application.cpp: In member function 'void GPG_Application::stopEngine()':
/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/marshal.h:12: error: too many arguments to function 'PyObject* PyMarshal_WriteObjectToString(PyObject*)'
GPG_Application.cpp:720: error: at this point in file

Are we offically not supporint older versions of python now? :)

Kent
2008-09-06 02:46:11 +00:00
Campbell Barton
cfa07e8d2b BGE Py api, deleting properties didnt raise an error when the property wasnt there. also added some exception messages and renamed joystick getConnected() to isConnected() 2008-09-03 06:43:07 +00:00
Benoit Bolsee
becd467be8 BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):

The face paremeter determines the orientation of the normal: 
  0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
  1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
    prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
    prop off, xray on : idem.
    prop on,  xray off: return closest hit if it matches prop, no hit otherwise.
    prop on,  xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.

The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.

Attributes (read-only):
 matname: The name of polygon material, empty if no material.
 material: The material of the polygon
 texture: The texture name of the polygon.
 matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
 v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
 v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
     use this to retrieve vertex proxy from mesh proxy
 visible: visible state of the polygon: 1=visible, 0=invisible
 collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
 getMaterialName(): Returns the polygon material name with MA prefix
 getMaterial(): Returns the polygon material
 getTextureName(): Returns the polygon texture name
 getMaterialIndex(): Returns the material bucket index of the polygon. 
 getNumVertex(): Returns the number of vertex of the polygon.
 isVisible(): Returns whether the polygon is visible or not
 isCollider(): Returns whether the polygon is receives collision or not
 getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
 getMesh(): Returns a mesh proxy

New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
 getNumPolygons(): Returns the number of polygon in the mesh.
 getPolygon(index): Gets the specified polygon from the mesh.

More details in PyDoc.
2008-08-27 19:34:19 +00:00
Campbell Barton
d566765635 get/set Angular velocity for KX_GameObjects python api and for the AddObject actuator.
Needed so objects created in an explosion could start spinning without having motion actuators and collision sensors on each item.
2008-08-27 03:34:53 +00:00
Campbell Barton
47c2271d67 Python API get/setObject update for Actuators. (SetParent, AddObject, Camera and TrackTo)
* bugfix for BGE python api - SetParent actuator getObject would segfault if the object was not set.
* Added utility function ConvertPythonToGameObject() that can take a GameObject, string or None and set the game object from this since it was being done in a number of places.
* allow setObject(None), since no object is valid for actuators, Python should be able to set this.
* added optional argument for getObject() so it returns the KX_GameObject rather then its name, would prefer this be default but it could break existing games.
2008-08-14 08:58:25 +00:00
Campbell Barton
3f2cb6e878 game engine python api
* removed macros that were not used much, some misleading.
* removed error string setting calls that overwrote the error set by PyArg_ParseTuple with a less useful one.
* use python macros Py_RETURN_NONE, Py_RETURN_TRUE, Py_RETURN_FALSE
2008-08-14 03:23:36 +00:00
Campbell Barton
2345757746 raise an error when assigning properties to a game object that cant be converted. also use python apis functions for converting floats and int types (faster then PyArg_Parse) 2008-08-12 12:32:54 +00:00
Hamed Zaghaghi
a49c9c458a improvement of 2d-filter custom shader,
some bugfixes,
now you can use depth buffer and luminance buffer without any settings,
also you can use object's properties in a shader
2008-07-12 10:21:37 +00:00
Campbell Barton
bbf1ce2762 bugfix - GameEngine PyObject methods did not all return when using dir(), because inherited methods were ignored, This made it incredibly annoying, not only having to search a C++ file to see what functions were available. but looking up methods inherited from other C++ classes.
There is still no __members__ attribute so dir() wont work at all for attributes.
2008-07-08 17:57:31 +00:00
Campbell Barton
5c93e75682 non user visible changes and small optimizations to the game engine pyapi as well as fixing some bugs.
* 2 returning errors without exception set another return None instead of NULL.
* a missing check for parent relation
* BPY matrix length was incorrect in matrix.c, this change could break some scripts, however when a script expects a list of lists for a matrix, the len() function is incorrect and will give an error. This was the only thing stopping apricot game logic running in trunk.

Also added a function for GameObjects  -  getAxisVect(vec), multiplies the vector be the objects worldspace rotation matrix. Very useful if you want to know what the forward direction is for an object and dont want to use Blender.Mathutils which is tedious and not available in BlenderPlayer yet.
2008-07-04 00:05:50 +00:00
Campbell Barton
11cdc2a002 Python API/Game engine fixes, dosn't affect 2.47
* Action FrameProp was checking if the string was true, not that it contained any text.
* Added GameObject.getVisible() since there is already a getVisible
* Added GameObject.getPropertyNames() Needed in apricot so Franky can collect and throw items in the level without having the names defined elsewhere or modifying his game logic which is stored in a separate blend file.
2008-06-26 12:39:06 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Benoit Bolsee
0db0f5734d Various mem leaks related to CValue reference count fixed 2008-03-01 19:46:50 +00:00
Nathan Letwory
15da2232f7 * tweak linking priorities - should help for GCC users
* some lib renaming
2008-01-08 09:47:44 +00:00
Chris Want
5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
Kent Mein
4e2143f639 This commit fixes up a bunch of svn properties to hopefully make things a little nicer for everyone.
Patch provied by gsrb3d

bug tracker #7061

Kent
2007-08-28 10:07:08 +00:00
Hans Lambermont
55cde4276b Finally commit a workaround for the Python>2.3 and FreeBSD>5.0 problem.
See http://projects.blender.org/pipermail/bf-committers/2005-April/010506.html
and projects.blender.org/pipermail/bf-committers/2006-December/017035.html

A workaround was proposed by Kester Maddock
http://projects.blender.org/pipermail/bf-committers/2005-April/010510.html
and recently again, independently by Andreas Kasparz (no URL, private email)

See also http://svn.python.org/projects/python/tags/r24c1/Include/pyport.h,
starting line 430 : "On 4.4BSD-descendants, ctype functions serves the
whole range of wchar_t character set rather than single byte code points
only. This characteristic can break some operations of string object..."
2007-02-18 21:03:23 +00:00
Jean-Luc Peurière
d7aaa84dd9 Fix for getting gcc compile GE with Py 2.5
PYobject type has changed

Usual C++ pickyness about implicit casts

debug made with erwin. thanks

Note to python mainteners :

even if it compiles there is a *Huge* list of warnings about deprecated
and incompatible pointers in api2.2. this should be corrected
2006-12-03 20:27:59 +00:00
Jacques Beuarain
24f4440d05 CMake lists initial submission. Documentationand further verification for different platforms will follow soon. This was just tested against current CVS on MSVC 2005 with Verse, QuickTime, OpenEXR, Player all on. 2006-11-17 02:27:12 +00:00
Nathan Letwory
ef1b7a5735 ==SCons==
+ 'scons blenderplayer' builds blender AND blenderplayer now (tested on Linux
  only, but was only linking issue, so should work on other platforms too).

  NOTE: I noticed some compileflags for GE specific libs that were left out -
  I re-enabled them in the SConscripts, but I'm going to do a test build my-
  self now, so if there are problems with them on win32, I probably already
  know about them :)
2006-02-07 21:24:36 +00:00
Nathan Letwory
3bb82a27fc == SCons ==
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan
2006-02-04 14:15:10 +00:00
Erwin Coumans
18857a6225 prepared physics/game engine infrastructure for vehicle support.
fixed a python related bug with physics contraints
fixed some line-ending problem with blenderbuttons.c

makefile/scons/projectfiles need to add source/gameengine/Ketsji/KX_VehicleWrapper.cpp
2006-01-30 20:33:59 +00:00
Erwin Coumans
2e6d576182 Sorry to break the cvs-closed status, so if you really need to make a new 2.40 build, just disable the game engine if it doesn't compile for a platform. Again, sorry if this breaks non-windows platforms, but I hope people help to get this amazing fix working for all platforms. Armature-fixing contribution from Snailrose. Also lots of cool things from Snailrose and Lagan.
Armatures are back
Split screen
Double sided lightning
Ambient lighting
Alpha test
Material IPO support (one per object atm)
Blender materials
GLSL shaders - Python access
Up to three texture samplers from the material panel ( 2D & Cube map )
Python access to a second set of uv coordinates

See http://www.elysiun.com/forum/viewtopic.php?t=58057
2006-01-06 03:46:54 +00:00
Erwin Coumans
9119b6e8a5 Fixed several bugs: python refcounting related and Bullet related (basic add/remove object support, bounding volume hierarchy). Added a few files, updated the Bullet scons. Vc6/7 Bullet projectfiles need to add a couple of files: 'Bullet/CollisionShapes/BvhTriangleMeshShape.cpp',
'Bullet/CollisionShapes/ConvexTriangleCallback.cpp',
'Bullet/CollisionShapes/EmptyShape.cpp',
'Bullet/CollisionShapes/OptimizedBvh.cpp',
'Bullet/CollisionShapes/TriangleCallback.cpp',
'Bullet/CollisionShapes/TriangleIndexVertexArray.cpp',
'Bullet/NarrowPhaseCollision/ManifoldContactAddResult.cpp'.
Sorry, no armatures fix yet.
2005-12-31 07:20:08 +00:00
Erwin Coumans
d59531226f Forgot to add 'ForgetReference' for game-python objects. 2005-12-20 09:13:06 +00:00
Erwin Coumans
e1c66eb145 applied the 64-bit pointer patch submitted by Ken Hughes 2005-11-28 06:51:54 +00:00
Kester Maddock
0dcba86c6b Added the docs & use Python booleans for physics reinstance. 2005-04-23 12:25:21 +00:00
Kester Maddock
c844aa265a Big patches:
Erwin Coumans: Abstract the physics engine
Charlie C: Joystick fixes
Me: Moved the ray cast (shadows, mouse sensor & ray sensor)
2005-03-25 10:33:39 +00:00
Jean-Luc Peurière
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
Kester Maddock
46fbe6b01e Fix for bugs: 1788 (forces) and 1799 (python delattr on game objects)
Use Polytope collision for faster mesh intersection tests, so SOLID can actually use that qhull lib now.
2004-11-22 10:19:19 +00:00
Kester Maddock
baa2f99f07 Port Python updates from Tuhopuu2:
getType/setType to action/sound actuator (sgefant)
Use a more generic python -> math conversion.
2004-07-17 05:28:23 +00:00
Kester Maddock
c16444e624 Python updates:
Added scene module
2004-06-07 11:03:12 +00:00
Kester Maddock
44f45894c2 Miscellaneous Fixes:
Add Python Mapping method to CListValue
Fix Bernoulli bool distribution python method for random actuator
Fix Python IpoActuator methods setProperty and force acts local
Make data objects private
Better sort method for polygon materials - much easier to understand
2004-06-04 03:00:13 +00:00
Kester Maddock
1217928e66 Fixes for Camera objects and python:
Normalise clip planes for sphere testing.
Do a frustum-sphere <-> sphere test
Reference count all python objects (!)
2004-05-21 09:18:42 +00:00
Kester Maddock
d5fde6c48b Added #!/usr/bin/python standard script identifier to the start of SConscript files.
Makes text editors identify SConscripts as Python, and syntax highlight properly.
2004-05-16 13:07:20 +00:00
Kester Maddock
2fd6e72851 Changed Python _getattr/_setattr methods to use const STR_String& instead of char* - makes using these methods much nicer. 2004-05-16 13:05:15 +00:00
Kester Maddock
63048b6cf4 Synchronise game engine with Tuhopuu2 tree. 2004-04-24 06:40:15 +00:00
Michel Selten
70a4ead0ae SCons updates
* Blender static now links. By default this option is disabled on all
  platforms. Simply set the option in config.opts to 'true'.
* Added the following flags to config.opts:
  - HOST_CC.    This is the C compiler for the host platform. This value is the
                same as TARGET_CC when not cross compiling.
  - HOST_CXX.   This is the C++ compiler for the host platform. This value is
                the same as TARGET_CXX when not cross compiling.
  - TARGET_CC.  This is the C compiler for the target platform.
  - TARGET_CXX. This is the C++ compiler for the target platform.
  - TARGET_AR.  This is the linker command for linking libraries.
  - PATH        This is the standard search path
  All SConscript files have been updated to reflect these changes. Now it's
  possible to change only the root SConstruct file, and all compiler specific
  variables are passed automatically to all SConscript files. Of course, this
  does not apply to makesdna because there the host and target platform is
  different from all other libraries.
  To pass a variable that applies to all platforms, all we now have to do is
  set the correct value in library_env


Note: as usual, to get the latest options in the config.opts file, first
      remove your version.
2004-02-29 21:40:48 +00:00
Michel Selten
9e238d385d SCons updates
* Almost all library settings are now available in the config.opts user option
  file.
* All platform variables had to be updated to make this possible. Things are
  much clearer now, but I only was able to test the changes on Linux. I've
  tried to update all other platform variables, but things are most likely to
  be broken. Please contact me how to resolve the issues.


Note: Before running scons, remove your existing config.opts file to get all
      new options.
2004-02-21 15:13:15 +00:00
Michel Selten
9330e553e8 SCons updates
* libraries are now generated in [BUILD_DIR]/lib
* passed the user_options to all libraries now.
  This means I could remove a couple of Export/Import lines.
* Changed the order in source/blender/src/SConscript and
  source/gameengine/SConscript.
  All libraries are now sorted alphabetically. This has no impact on the build
  process.
2004-02-15 19:25:32 +00:00
Michel Selten
2883110a54 SCons updates: (All done by jesterKing)
* Windows .exe file now includes the blender icon.
* Builds with game engine on Windows only.
  I tried building the game engine on Linux, but I get weird errors when
  building with ode. There's a dirty #include path in
  Physics/BlOde/OdePhysicsEnvironment.cpp (../ode/src/joint.h). gcc doesn't
  like this somehow.
* Other platforms need to add a couple of flags to the SConstruct:
  use_sumo, use_ode, solid_include and ode_include
2004-01-20 20:28:39 +00:00
Wouter van Heyst
57a7dfe5a5 - Revert to NaN makefiles 2004-01-05 00:06:11 +00:00
Alejandro Conty Estevez
eff07b8329 Basic initial yafray integration by Eeshlo.
Materials are exported the best we can do by now. It will look almost as in
blender except for the missing procedural textures and some minor issues.
You have to tweak normal modulation amount to get the desired result cause
is not the same in yafray.

We added a panel in render space to adjust some yafray settings (GI and so)

Also we export transparency and reflection using new raytracing settings,
but that will be changed and improved soon.

Remember that you have to set YFexport path in user defaults and yafray must
be on path (version 0.0.6)

We added the "yafray" button to activate all this stuff in the render window.
Panel and settings are only shown when checked.

So now when activated the code calls yafray export instead of the internal
renderer and finally the resulting image is loaded back into render window's
buffer. So animation is also possible and results can be saved using blender
usual scheme.
2004-01-04 22:10:36 +00:00
Roel Spruit
ffabbbea8d Nathan Letwory's patch for bug #424 const errors kept MSVC7 projectfiles from compiling. 2003-12-01 15:01:20 +00:00
Wouter van Heyst
22305bc08d FreeBSD can use the exact same python includes as everyone else 2003-03-25 23:36:40 +00:00
Hans Lambermont
302399b9d0 and the other FreeBSD python locations. 2003-01-04 01:41:19 +00:00
Kent Mein
f1c4f705a1 Removed the config.h thing from the .h's in the source dir.
So we should be all set now :)

Kent
--
mein@cs.umn.edu
2002-12-27 13:11:01 +00:00
Kent Mein
209a2ede2c Last of the config.h mods...
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

added to these files.

Kent
--
mein@cs.umn.edu
2002-11-25 15:29:57 +00:00
Kent Mein
b9a19f1ea7 Did all of the .h's in source
(adding)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

also the Makefile.in's were from previous patch adding
the system depend stuff to configure.ac

Kent
--
mein@cs.umn.edu
2002-11-25 11:16:17 +00:00
Kent Mein
01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Erwin Coumans
b8c8715c20 moved KX_Python_... files from ketsji to expressions
(ketsji was a very wrong location because it caused circular dependencies between expressions, gamelogic and ketsji)
expressions and game logic are not dependent on ketsji anymore (only the other way around)
also removed circular includes in makefiles and projectfiles
2002-10-21 19:23:52 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00