Commit Graph

321 Commits

Author SHA1 Message Date
Campbell Barton
9f5621bb4a Cleanup: comment blocks 2016-07-02 10:08:33 +10:00
Campbell Barton
2465bd90d5 Cleanup: style, whitespace, doxy filepaths 2016-06-19 06:33:29 +10:00
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Porteries Tristan
95164a09a7 BGE: generic python callback list + replace KX_PythonSeq.
I made this patch to declared a python list without converting all elements in python object (too slow) or use a CListValue which required CValue items (too expensive in memory).  In the case of a big list of points like a collision contacts points list, to use a CListValue we must implement a new class based on CValue for 3D vector to create a python proxy even if mathutils do it perfectly, we must also convert all points (frequently ~100 points) when fill the CListValue even if the list is not used (in the case of the collision callback). The easy way is to use callback (it doesn't worth to do an inheritance) which convert the item in PyObject only during an acces.
5 callbacks are used :
- Check if the list is valid = allow acces (like PyObjectPlus.invalid)
- Get the list size
- Get an item in the list by index.
- Get an item name in the list by index (used for operator `list["name"]`)
- Set an item in the list at the index position.
All of these callback take as first argument the client instance.
Why do we use a void * for the client instance ? : In KX_PythonInitTypes.cpp we have to initialize each python inherited class, if we use a template (the only other way) we must add this class each time we use a new type with in KX_PythonInitTypes.cpp

To check if the list can be accessed from python by the user, we check if the python proxy,  which is the `m_base` member, is still a valid proxy like in PyObjectPlus. But we can use a callback for more control of user access (e.g a list of collision point invalidate a frame later, in this case no real python owner).

This python list is easily defined with :
```
CPythonCallBackList(
void *client, // The client instance
PyObject *base, // The python instance which owned this list, used to know if the list is valid (like in KX_PythonSeq)
bool (*checkValid)(void *), // A callback to check if this list is till valid (optional)
int (*getSize)(void *), // A callback to get size
PyObject *(*getItem)(void *, int), // A callback to get an item
const char *(*getItemName)(void *, int), // A callback to get an item name (optional) use for acces by string key
bool (*setItem)(void *, int, PyObject *) // A callback to set an item (optional)
)
```
To show its usecase i replaced the odd KX_PythonSeq, it modify KX_Gameobject.sensors/controllers/actuators, SCA_IController.sensors/actuators and BL_ArmatureObject.constraints/channels.

Example : {F245193}, See message in console, press R to erase the object and see invalid proxy error message.

Reviewers: brita_, #game_python, youle, campbellbarton, moguri, agoose77, sergey

Reviewed By: campbellbarton, moguri, agoose77, sergey

Subscribers: sergey

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1363
2015-10-26 20:27:08 +01:00
Campbell Barton
09e40a4956 Cleanup: spelling 2015-09-14 02:22:22 +10:00
Jorge Bernal
6ffc988ae3 BGE Clean-up: New EXP prefix for the BGE Expression module
The expression module now uses an EXP prefix and it follows a
distribution similar to blender.

Additionally the hash function in EXP_HashedPtr.h was simplified and the
files EXP_C-Api.h &.EXP_C-Api.cpp were deleted because were unused.

Reviewers: campbellbarton, moguri, sybren, hg1

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1221
2015-07-12 16:58:12 +02:00
Campbell Barton
6b3a43ccb4 BGE: dissallow calling reverse on internal clists 2015-06-20 20:02:16 +10:00
Campbell Barton
75a86d6a8e Fix for building without Python 2015-06-14 04:53:10 +10:00
Campbell Barton
33a7b72678 Fix T44919: BGE marhutils attrs leak memory 2015-06-02 11:08:17 +10:00
Campbell Barton
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
Sergey Sharybin
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05:00
Sybren A. Stüvel
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
Sybren A. Stüvel
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
Porteries Tristan
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
Porteries Tristan
7730391d74 BGE: subclass with more than 1 argument, D1237
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

    class Player(types.KX_GameObject):
        def __init__(self, gameobj, life):
            print("create new player :", self, ", life :", life)

    player = Player(own, 50)
2015-04-15 22:02:16 +10:00
Thomas Szepe
38c30c41d7 BGE: Fix ShowDeprecationWarning macro.
Reviewers: lordloki, brita_, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1144
2015-02-27 23:10:43 +01:00
Campbell Barton
b240b8e231 Freestyle: reserve array sizes before filling
also use PyList_GET_ITEM when list size is known.
2015-01-04 21:23:26 +11:00
Campbell Barton
8106a6b75d mathutils: refactor instantiation
remove 'type' argument, very few mathutils objects are wrapped,
add new function for creating wrapped objects.

also fixes unlikely memory leak if the data-array can't be allocated.
2015-01-04 17:43:57 +11:00
Campbell Barton
3f2cf6da6f Cleanup: remove _DEBUG define usage 2014-08-27 18:59:32 +10:00
Campbell Barton
10af70cef8 Support for building without Python 2014-06-17 22:00:13 +10:00
Jorge Bernal
8c16f4c7d0 BGE: New Property sensor evaluation types
This patch adds "Less Than" and "Greater Than" evaluation types to the property sensor.
The Wiki Docs modifications http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Sensors/Property
Also, I have attached a screenshot and a blend to check.

Reviewers: dfelinto, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D476
2014-06-16 14:56:36 -07:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
Mitchell Stokes
33e52d0df4 BGE: Fix for [#34398] "«illegal operator» in Expression Controller" reported by Andrey Kashlak (andreymal)
The expressions system now supports the not operator on ints and floats.
2013-07-22 22:46:17 +00:00
Antony Riakiotakis
dda61cc82f Fix some definitions for MinGW64 2013-07-19 19:19:15 +00:00
Campbell Barton
02ba328ca8 clang/cmake - quiet warnings for external libs and reference moto as a system include. 2013-07-15 08:26:16 +00:00
Campbell Barton
9cf6e305a9 split bge includes for scons onto their own lines (for easier merging) 2013-05-29 21:56:55 +00:00
Bastien Montagne
e9f0b1ad0a Grr, forgot this in r57127...
BF_PYTHON_INC can contain more than one path (in the mono-string format), don't know how this could not be found earlier, completely broke build of GE on any recent Debian/Ubuntu distro???
2013-05-29 18:59:59 +00:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Campbell Barton
854fd94016 bge py api: raise an overflow exception when assigning a float to a bge object which is out of the float range.
also avoid raising exceptions by ConvertPythonToValue when they will be ignored.
2013-05-03 01:13:51 +00:00
Campbell Barton
3f7f07faf5 style cleanup 2013-04-18 01:52:38 +00:00
Campbell Barton
8c1cb10cfd code cleanup: unused vars, make other vars static. 2013-04-10 22:49:50 +00:00
Campbell Barton
0874237358 code cleanup: bge warnings 2013-04-04 23:16:23 +00:00
Campbell Barton
ab41583bc2 style cleanup 2013-03-29 06:21:28 +00:00
Campbell Barton
64d161de87 style cleanup:
also rename mesh_getVertexCos() --> BKE_mesh_vertexCos_get() to match curve function.
2013-03-26 07:29:01 +00:00
Campbell Barton
e1a54214bb code cleanup:
- remove unused defines.
- quiet some shadow warnings.
- bevel, ifdef out some asserts that are too common.
- style
2013-03-25 02:41:30 +00:00
Dalai Felinto
4a5a5f2968 bge bugfix: [#34677] Setting Boolean property on KX_GameObject creates Int type
we need to check for booleans before testing for longs.
2013-03-18 22:52:43 +00:00
Campbell Barton
2921d48239 code cleanup: unused vars in collada, preprocessor formatting & warning in mingw.
also compiling without bullet needed a stub added.
2013-03-04 00:53:57 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +00:00
Campbell Barton
761ac89877 style cleanup 2013-01-15 23:45:41 +00:00
Campbell Barton
68d83f4140 quiet compiler warning with string formatting in CParser::Term 2013-01-12 15:32:05 +00:00
Campbell Barton
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
Bastien Montagne
ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +00:00
Campbell Barton
3fd388fb06 py api cleanup, replace use...
- PyLong_FromSsize_t --> PyLong_FromLong
- PyLong_AsSsize_t --> PyLong_AsLong

In all places except for those where python api expects PySsize_t (index lookups mainly).

- use PyBool_FromLong in a few areas of the BGE.
- fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used.
2012-11-21 02:28:36 +00:00
Campbell Barton
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
Campbell Barton
67b74f96da - property sensor was converting floating point values to text then back to float - for floating point properties.
- IntValue's GetNumber() was convert int -> float -> double.
- BL_Shader was using STR_String rather then char*, where most callers had a char*, use a char* to avoid STR_String conversion-and-alloc on shader access.
2012-11-10 22:32:15 +00:00
Campbell Barton
936f0388e8 code cleanup: some warnings and formatting for PyMethodDef's in the BGE. 2012-11-10 05:42:50 +00:00
Campbell Barton
d25b13d13f code cleanup: double promotion warnings, also allow cmake to build SDL without audaspace. 2012-11-09 16:15:00 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00