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 API cleanup - no functionality changesCampbell Barton
- 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-18Added m_zombie to the base python class (PyObjectPlus), when this is set all ↵Campbell Barton
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-15Disable using KX_GameObjects in python that have been removed from the scene ↵Campbell Barton
(zombie objects) by raising a RuntimeError when accessing methods, attributes or passing to a function. Common cases of this are when python references an object from the AddObject actuator that has ended, or a scene has been loaded and the old objects freed. This means some scripts will raise errors now in certain cases but better give the error early rather then failing silently with strange hard to track down behavior & crashes. Added "isValid" attribute for checking objects are in a scene. At the moment it uses the SceneGraph Node to check of the objects valid but it might be better to do this in a more generic way so scenes, meshes etc also have this check.
2009-04-10Added function name to many of the PyArg_ParseTuple calls in gameengineAndre Susano Pinto
This way python raises more useful messages.
2009-04-07BGE Python APICampbell Barton
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-05BGE Python APICampbell Barton
- made camera use PyAttributeDef's - removed unneeded duplicate matrix type checks - fixed own bug (added since 2.48a) that broke a converting 4x4 matrix to a PyObject
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-03BGE Python apiCampbell Barton
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-02-26Py BGE APICampbell Barton
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-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-02-21* removed typedefs that were not used (from anonymous enums and structs)Campbell Barton
* 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-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-04VideoTexture: new ImageMirror class for easy mirror (and portal) creationBenoit Bolsee
The new class VideoTexture.ImageMirror() is available to perform automatic mirror rendering. Constructor: VideoTexture.ImageMirror(scene,observer,mirror,material) scene: reference to the scene that will be rendered. Both observer and mirror must be part of that scene. observer: reference to a game object used as view point for mirror rendering: the scene will be rendered through the mirror as if the active camera was at the observer location. Usually the observer is the active camera but you can use any game obejct. mirror: reference to the mesh object holding the mirror. material: material ID of the mirror texture as returned by VideoTexture.materialID(). The mirror is formed by the polygons mapped to that material. There are no specific methods or attributes. ImageMirror inherits all methods and attributes from ImageRender. You must refresh the parent VideoTexture.Texture object regularly to update the mirror rendering. Guidelines on how to create a working mirror: - Use a texture that is specific to the mirror so that the mirror rendering only appears on the mirror. - The mirror must be planar; the algorithm works well only for planar or quasi planar mirror. For spherical mirror, you will get better results with ImageRender and a camera at the center of the mirror. ImageMirror automatically computes the mirror orientation and position. The mirror doesn't need to be rectangular, it can be circular or take any form provided it is planar. - The mirror up direction must be along the Z axis in local mesh coordinates. If the mirror is not vertical, ImageMirror will compute the up direction as being the projection of the Z axis on the mirror plane. - UV mapping must be set right to get correct mirror rendering: - make a planar projection of the mirror polygons (Unwrap or projection from view) - eventually rotate the projection so that UV up direction corresponds to the mesh Z axis - scale the projection so that the extreme points touch the border of the texture - flip the UV projection horizontally (scale -1 on X axis). This is needed because the mirror texture is rendered from the back of the mirror and thus is reversed from the view point of the observer. Horizontal flip in the UV map restores the correct orientation. Besides these simple rules, the mirror rendering is completely automatic. In particular, you don't need to allocate a camera for the rendering, ImageMirror creates dynamically a camera for that. The reflection is correct even on large angles. The mirror can be a dynamic and moving object, the algorithm always computes the correct camera position based on observer relative position. You don't have to worry about mirror position in the scene: the algorithm automatically computes the camera frustum so that any object behind the mirror is not rendered. Warnings: - observer and mirror are references to game objects. ImageMirror keeps a pointer to them but does not increment the reference count. You must ensure that these game objects are not deleted as long as you refresh() the ImageMirror object. You must release the ImageMirror object before you delete the game objects. To release the ImageMirror object (normally stored in GameLogic), just assign it to None. - Mirror rendering is automatically skipped when the observer is behind the mirror but it is not disabled when the mirror is out of sight of the observer. You should only refresh the mirror when you know that the observer is likely to see it. For example, no need to refresh a car inner mirror when the player is not in the car. Example: contr = GameLogic.getCurrentController() # object holding the mirror mirror = contr.getOwner() scene = GameLogic.getCurrentScene() # observer will be the active camere camera = scene.getObjectList()['OBCamera'] matID = VideoTexture.materialID(mirror, 'IMmirror.png') GameLogic.mirror = VideoTexture.Texture(mirror, matID) GameLogic.mirror.source = VideoTexture.ImageMirror(scene,camera,mirror,matID) # to render the mirror, just call GameLogic.mirror.refresh(True) on each frame. You can download a demo game (with a video file) here: http://home.scarlet.be/~tsi46445/blender/VideoTextureDemo.zip For those who have already downloaded the demo, you can just update the blend file: http://home.scarlet.be/~tsi46445/blender/MirrorTextureDemo.blend
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-07-01Checked all cases where PyArg_ParseTuple is used in blenders game engine and ↵Campbell Barton
made sure all will raise errors when called with invalid args.
2008-05-24fix BGE bug #8646: unusable anaglyph settingsBenoit Bolsee
The best rules for stereo rendering are now applied to Blender. Here is the new situation: 1) The focal distance is now settable through the GUI: select the camera (each camera can have a different setting) and go to the camera data (F9): the "Dof Dist" and "Dof Ob" can be used to set the focal distance for that camera. The "Dof Ob" is interesting because it sets the focal distance so that the center this object will appear at the surface of the screen when running the game. 2) The eye separation is automatically set to focal_distance/30, which is considered to be a reasonable value. If you need a different value, you can always use Python scripting. Notes: - If you switch camera during the game, the focal distance will also change unless you have set the focal distance by scripting, in which case it overwrites the focal distance setting of all cameras. - If you don't set the focal distance in the camera data or by scripting, the default value will be used. The default value corresponds more of less to the near clipping plane which means that all the objects will be very far with little 3D effect. - If you don't set the eye separation by scripting, it is automatically computed as focal_distance/30, regardless on how the focal distance was set.
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!
2008-04-15fix BGE bug #8309: After Parent Object added to the visual layer, Child ↵Benoit Bolsee
Camera won't follow. This bug fix is made of two parts: 1) It's now possible to dynamically add a camera. 2) Empty camera name on a SetCamera actuator now points to the actuator's parent object if this object is a camera. This trick is useful to make current a dynamically created camera: just add a SetCamera actuator on the camera itself and leave the name empty. Later, when the camera is added in the scene with an AddObject actuator, either directly or via a parent object, you just need to activate the actuator to make the newly created camera current. If you set a name on a SetCamera actuator, it will always point to the original camera, even after replication.
2008-03-01Various mem leaks related to CValue reference count fixedBenoit Bolsee
2008-02-16patch 8235 8218 8211 added: various gameengine improvements, fixed windows ↵Benoit Bolsee
project files
2007-04-04moved source and text to american spellingCampbell Barton
* colour -> color * centre -> center * normalise -> normalize * modelling -> modeling
2006-01-06Sorry to break the cvs-closed status, so if you really need to make a new ↵Erwin Coumans
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
2004-07-22Fix bug #1460: Camera IPOs Broken (Gameengine)Kester Maddock
The camera IPO was not invalidating the cached projection matrix.
2004-07-20Added support for cameras in Blender's Ortho mode.Kester Maddock
2004-07-17Port Python updates from Tuhopuu2:Kester Maddock
getType/setType to action/sound actuator (sgefant) Use a more generic python -> math conversion.
2004-06-07Python updates:Kester Maddock
Added scene module
2004-05-30Check for zero normal vectors in the clip planes (if eg Python has set a ↵Kester Maddock
strange projection matrix) Fix the transformation of the frustum bound sphere to world coordinates.
2004-05-26Python fixes:Kester Maddock
Reenabled the setScript/getScript methods for python controller bricks. Set the ray source point to MouseFocusSensor.getRaySource works. Added: Python -> MT_Quaternion MT_Matrix4x4, MT_Matrix3x3, MT_Vector3, MT_Point3 -> Python Correct transform of frustum bound sphere centre point to world coordinates
2004-05-21near & far are reserved words on MSVC. Don't use them as variable names.Kester Maddock
2004-05-21Fixes for Camera objects and python:Kester Maddock
Normalise clip planes for sphere testing. Do a frustum-sphere <-> sphere test Reference count all python objects (!)
2004-05-16Frustum cullingKester Maddock
New Python Hooks for cameras.
2004-04-26Fix MouseFocus Sensor objects for dynamic cameras. (Bug 1165)Kester Maddock
2004-04-24Synchronise game engine with Tuhopuu2 tree.Kester Maddock
2004-03-23[GameEngine] Commit all Kester's changes made to the gameengine to restore ↵Nathan Letwory
2.25 like physics. [SCons] Build with Solid as default when enabling the gameengine in the build process [SCons] Build solid and qhull from the extern directory and link statically against them That was about it. There are a few things that needs double checking: * Makefiles * Projectfiles * All the other systems than Linux and Windows on which the build (with scons) has been successfully tested.
2002-11-25Last of the config.h mods...Kent Mein
#ifdef HAVE_CONFIG_H #include <config.h> #endif added to these files. Kent -- mein@cs.umn.edu
2002-10-12Initial revisionv2.25Hans Lambermont