Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-05-06moved py controller functions from SCA_PythonController to SCA_IController - ↵Campbell Barton
the base controller class so python can get the sensors & actuators from any controller (not just SCA_PythonController types) also deprecated getActuators() and getSensors() for 'sensors' and 'actuators' attributes. an example of getting every sensor connected to an object. all_sensors = [s for c in ob.controllers for s in c.sensors]
2009-05-02BGE PyController module type.Campbell Barton
- Added support for any number of attributes, this means packages are supported automatically. so as well as "myModule.myFunc" you can do "myPackage.myModule.myFunc", nested packages work too. - pass the controller to the python function as an argument for functions that take 1 arg, this check is only done at startup so it wont slow things down. added support for
2009-04-29BGE alternative run mode for python controllers.Campbell Barton
Option to run a function in a module rather then a script from a python controller, this has a number of advantages. - No allocating and freeing the namespace dictionary for every time its triggered (hard to measure the overhead here, but in a test with calling 42240 scripts a second each defining 200 vars, using modules was ~25% faster) - Ability to use external python scripts for game logic. - Convenient debug option that lets you edit scripts while the game engine runs.
2009-04-04moved more attributes from getattr into PyAttributeDef'sCampbell Barton
2009-04-03Python BGE APICampbell Barton
- 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-02-24BGE Py APICampbell Barton
* Made GameLogic.addActiveActuator(actu, bool) to raise an error if the actuator is not in the list. Before it would allow any value as the actuator and fail silently (makes debugging scripts more difficult). * Allow the actuator to be a string which is convenient if you dont want to change the settings of the actuator. * Added activate/deactivate functions to the controller, this is more logical since the GameLogic.addActiveActuator() function is running through the controller anyway. GameLogic.addActiveActuator(controller.getActuator("SomeAct"), True) ...can be replaced with... controller.activate("SomeAct")
2009-02-24compile scripts when converting controllers to give more predictable ↵Campbell Barton
performance and print syntax errors early on rather then when the script is first executed.
2009-02-19BGE Python APICampbell Barton
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.
2008-12-29First batch of GE API cleanup.Benoit Bolsee
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-09-20[#17600] char* -> const char*Campbell Barton
Thanks to Sean Bartell (wtachi), was causing many many warnings which distracted from the real problems.
2008-08-23BGE state system improvement: the sensor with Level option enabled will ↵Benoit Bolsee
trigger the controller of a newly activated state, even if the sensor is already connected to an active state; new isTriggered() python function to determine which sensor triggered the current controller. Previously, this behaviour was available only for sensors that were not connected to any active state, which was forcing the game designer to duplicate sensors in some cases. For example the Always sensors used to initialize the states needed to be duplicated for each state. With this patch, a single Always sensor with Level option enabled will suffice to initialize all the states. A Python controller can determine which sensor did trigger with the new SCA_ISensor::isTriggered() function. Notes: - When a sensor with level option enabled is connected to multiple controllers, only those of newly activated states will be triggered. The controllers of already activated states will receive no trigger, unless the sensor internal state toggled, in which case all the controllers are triggered as always. - The old isPositive() function returns the internal state of the sensor, positive or negative; the new isTriggered() function returns 1 only for sensors that generated an event in the current frame.
2008-07-04non user visible changes and small optimizations to the game engine pyapi as ↵Campbell Barton
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-06-30BGE python api addition, GameObject get/setState and Controller.getState()Campbell Barton
Also added a note in the tooltip for action priority when using more then 1 action at a time.
2008-04-17Patch from GSR that a) fixes a whole bunch of GPL/BL licenseChris Want
blocks that were previously missed; and b) greatly increase my ohloh stats!
2006-05-14GamePython related: changed ordering of python destruction, and reverted ↵Erwin Coumans
some python changes (it caused problems)
2004-05-16Changed Python _getattr/_setattr methods to use const STR_String& instead of ↵Kester Maddock
char* - makes using these methods much nicer.
2002-12-27Removed the config.h thing from the .h's in the source dir.Kent Mein
So we should be all set now :) Kent -- mein@cs.umn.edu
2002-11-25Did all of the .h's in sourceKent Mein
(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-10-12Initial revisionv2.25Hans Lambermont