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-04-19BGE Python APICampbell Barton
removed redundant (PyObject *self) argument from python functions that are not exposed to python directly.
2009-04-19BGE Python APICampbell Barton
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-16bpy_internal_import.c should build with py2.3 now, also gave ↵Campbell Barton
bpy_internal_import functions better names.
2009-04-15BGE Python APICampbell Barton
Free python modules defined within the blendfile between loading scenes since they would end up accessing old GameLogic, Rasterizer modules as well as old game engine data in the module namespace which can cause problems.
2009-04-15BGE Py ApiCampbell Barton
importing modules wasnt returning the error from the blender text if it failed.
2009-04-10BGE API cleanup: ConstraintActuator.Benoit Bolsee
2009-04-10BGE API cleanup: StateActuator.Benoit Bolsee
2009-04-10BGE API cleanup: sound actuator.Benoit Bolsee
2009-04-09Added GameKeys.EventToCharacter(event, is_shift) so you can get the ↵Campbell Barton
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-09BGE API cleanup: 2DFilterActuator.Benoit Bolsee
2009-04-08small bge editsCampbell Barton
- Only try and remove light objects from the light list. - Only loop over mesh verts once when getting the bounding box - dont return None from python attribute localInertia when theres no physics objects. better return a vector still. - add names to send message PyArg_ParseTuple functions.
2009-04-08BGE patch #18350: Add sendMessage() to GameLogic. Added sendMessage to both ↵Benoit Bolsee
GameLogic and KX_GameObject.
2009-04-07BGE Py APICampbell Barton
- Added OpenGL access to the game engine as a module so you can import BGL directly.
2009-04-06BGE Python APICampbell Barton
- added a module for the BGE - GameTypes, only contains types. - added KX_PYATTRIBUTE_DUMMY attributes for KX_Light, KX_PolyProxy, KX_VertexProxy, so all types should give correct results from a dir(). - added a script to check for missing methods in the epydocs - bge_api_validate_py.txt
2009-04-06- remove debug printfCampbell Barton
- remove test for importing the module rather then creating a new one (didnt mean to commit) - added constants for the mouse sensor to use.
2009-04-06Python ref-counting fixesCampbell Barton
2009-04-05BGE PyAPI can now import text (within the blend-file)Campbell Barton
Previously this only worked with the Blender API. - bpy_internal_import small C file that Blender scripting and the game engine use. - Tested with blender, blenderplayer, loading files - Needed to use a hack to override the Main struct since the game engine doesn't set G.main - when the sandbox is set, only internal scripts can be imported.
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-04-01BGE API cleanup: DynamicActuator, ReplaceMeshActuator, TrackToActuator.Benoit Bolsee
2009-03-31BGE API cleanup, patch from Moguri: RaySensor, NetworkMessageActuator, ↵Benoit Bolsee
NetworkMessageSensor.
2009-03-26Added attributes for Ipo Actuator settings (replacing all methods)Campbell Barton
2009-03-01BGE API cleanup: apply patch from Moguri: Near, Radar, Touch sensor updated.Benoit Bolsee
2009-02-28BGE Python APICampbell Barton
* Scene's and GameObjects can now be printed (raised an exception) * Added GameLogic.getSceneList()
2009-02-25remove warnings for the BGECampbell Barton
- 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-23BGE Python APICampbell Barton
* 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-01-22BGE API cleanup: shape action actuator.Benoit Bolsee
2008-11-01Preparation to VideoTexture: everything but the VideoTexture module itself.Benoit Bolsee
Rename PHY_GetActiveScene() to KX_GetActiveScene(): more logical name Add KX_GetActiveEngine() new KX_KetsjiEngine::GetClockTime(void) to return current render frame time: if the CPU does not keep up with the frame rate, up to 5 consecutive logic frames are processed between each render frame, so that the logic system stays accurate even if the graphic system is slow. For the video texture module, it is important to stay in sync with the render frame: no need to update the texture for logic frame. BL_Texture::swapTexture(): texture id manipulation BL_Texture::getTex() : return material texture Enable video support in ffmpeg for Linux.
2008-10-11Fix for a relative paths issue in the game engine. G.sce was beingBrecht Van Lommel
kept as the original file, but that can't work correct for solving relative paths once a .blend in another directory is loaded. The reason it went OK with the apricot tech demo is that the images there were lib linked into the level file, which still worked. Now it sets G.sce to the current loaded .blend file. Note that the python config file path still uses the first loaded .blend file so it looks in the same location each time. Also added some NULL pointer checks in the joystick code because it was crashing there on Mac, there's similar checks in related functions so I'm assuming this was just a missed case.
2008-10-03Blender works with python 2.6, our own import functions that replace pythons ↵Campbell Barton
internal function needed updating for an extra in argument in 2.6. if importing is not working blender should not crash (was crashing on exit)
2008-10-03error with GameLogic.globalDict loading. It would replace the dictionary ↵Campbell Barton
rather then updating it. This meant the BGE would load in an old dictonary replacing the loaded dict, loosing settings. was also missing a decref for marshal data
2008-10-02Python 2.4 should build with the game engine now, no thanks to python for ↵Campbell Barton
switching from char to const char
2008-09-25BGE patch: add advanced parameters for SoftBody. Add Rasterizer.drawLine() ↵Benoit Bolsee
Python function.
2008-09-22BGE patch: KX_STATEx constant to allow simple state manipulation in setState()Benoit Bolsee
The constants KX_STATE1 to KX_STATE30 can be used with setState() to change the object state in a python controller. The constants are defined in the GameLogic module so that the full name is GameLogic.KX_STATE1 to GameLogic.KX_STATE30 but you can simplify this with the import statement: from GameLogic import * cont = getCurrentController() ob = cont.getOwner() ob.setState(KX_STATE2) #go to state 2 KX_STATEx constants are defined as (1<<(x-1)) Binary operators |, &, ^ and ~ can be used to combine states: You can activate more than one state at a time with the | operator: ob.setState(KX_STATE1|KX_STATE2) #activate state 1 and 2, stop all others You can add a state to the current state mask with: state = ob.getState() ob.setState(state|KX_STATE3) #activate state 3, keep others You can substract a state to the current state mask with the & and operator: state = ob.getState() ob.setState(state&~KX_STATE2) #stop state 2, keep others You can invert a state with the ^ operator: state = ob.getState() ob.setState(state^KX_STATE2) #invert state 2, keep others
2008-09-22KX_PythonInit.cpp - workaround for current sandbox and possible fix. no real ↵Campbell Barton
change for now but others may want to look into it. blendef.h - removed some unused defines. editipo_mods.c - deselect all was selecting instead.
2008-09-16Fix (harmless) error print about GameLogic.globalDict being lost. AlsoBrecht Van Lommel
fixed some memory leaks in this code and simplified it.
2008-09-13Game engine: added Rasterizer.get/setMaterialMode to set texface,Brecht Van Lommel
multitexture or glsl materials. This does not affect existing scenes, only newly created ones.
2008-09-12save and load configuration actuator, (option in game actuator menu)Campbell Barton
saves a marshal'd GameLogic.globalDict to the blendfile path with the blend extension replaced with bgeconf Use this in YoFrankie to save keyboard layout and graphics quality settings.
2008-09-06object_find, didnt get images from an objects material texturesCampbell Barton
KX_PythonInit.cpp - own error in recent commit.
2008-09-06converted my gen_utils.h fix to PyObjectPlus.hKent Mein
Also added a fix for PyMarshal_WriteObjectToString Now I just need to figure out linking of the gameengine on my imac. Kent
2008-09-06Trying to keep things compiling on my imac (10.4.11)Kent Mein
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-05BGE Py APICampbell Barton
added exception messages for replaceMesh.setMesh() and allowed None as an argument. added exception messages for other BGE module functions.
2008-09-05Merge of first part of changes from the apricot branch, especiallyBrecht Van Lommel
the features that are needed to run the game. Compile tested with scons, make, but not cmake, that seems to have an issue not related to these changes. The changes include: * GLSL support in the viewport and game engine, enable in the game menu in textured draw mode. * Synced and merged part of the duplicated blender and gameengine/ gameplayer drawing code. * Further refactoring of game engine drawing code, especially mesh storage changed a lot. * Optimizations in game engine armatures to avoid recomputations. * A python function to get the framerate estimate in game. * An option take object color into account in materials. * An option to restrict shadow casters to a lamp's layers. * Increase from 10 to 18 texture slots for materials, lamps, word. An extra texture slot shows up once the last slot is used. * Memory limit for undo, not enabled by default yet because it needs the .B.blend to be changed. * Multiple undo for image painting. * An offset for dupligroups, so not all objects in a group have to be at the origin.
2008-09-04fix for 2 python refcounting errorsCampbell Barton
2008-08-29Use Py_ssize_t rather then int, broke building on 64bt linuxCampbell Barton
2008-08-29BGE Py API - GameKeys.EventToString() utility function, makes key ↵Campbell Barton
configuration menu's easier to write. own error with blenderplayer, wasnt decreffing the GameLogic module, probably didnt matter since python was restarted anyway, but is incorrect.
2008-08-28remove more python functions from builtins that could allow scripts to do ↵Campbell Barton
bad stuff. - reload, file, execfile, compile These are only removed when running in higher security mode thats not default in blender.
2008-08-22Fix Windows compilation problem and update MSVC project filesBenoit Bolsee
2008-08-22BGE Python API - GameLogic.getBlendFileList(path='//') to return a list of ↵Campbell Barton
blend's in the current directory. Needed for creating a level selector that lists all files in the level directory. CMakeFile include path to compile with recent changes.
2008-08-19Added GameLogic.globalDict, this is a place where data can be stored even ↵Campbell Barton
when new blend files are loaded. Using for apricot so frankie can go into levels in new blendfiles keeping his inventory, currently it dosnt work for the blenderplayer which stops python before loading new blend files.
2008-08-14game engine python apiCampbell Barton
* 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