Commit Graph

546 Commits

Author SHA1 Message Date
Campbell Barton
df19da3a8b CMake: remove helper text
Its out of date, better use the wiki building docs.
2015-06-30 22:46:55 +10:00
Sybren A. Stüvel
9f48aa45ad BGE: added clamping of angular velocity.
Angular velocity clamping was missing from the BGE. It is implemented
similarly to the linear velocity clamping. It is needed to be able to
drive physical simulations of systems that have a limited rotational
speed.

Reviewed by: campbellbarton, panzergame, ton

Differential Revision: https://developer.blender.org/D1365
2015-06-28 12:54:53 +02:00
Quentin Wenger
6f17fb8630 BGE: Missing dot in 2d filter actuator documentation. 2015-06-24 22:34:55 +02:00
Quentin Wenger
fc668df245 BGE: Fix 2dfilter actuator mode constants. 2015-06-24 15:31:55 +02:00
Porteries Tristan
90b4131d16 BGE: Fix 57065a, missing dots. 2015-06-23 14:57:38 +02:00
Campbell Barton
57065a6df5 Minor tweaks to bge.constraints docs 2015-06-23 21:58:08 +10:00
Campbell Barton
1c251d7cb6 Update bge.constraints API doc
D1357 by @Matpi with edits.
2015-06-23 21:37:28 +10:00
Campbell Barton
18f228d593 update hand written rst docs
- minor corrections
- link to new manual
- wrap lines at 120
2015-06-18 08:00:46 +10:00
Quentin Wenger
a62392dea7 BGE: remove outdated doc of KX_PolygonMaterial, update doc of KX_BlenderMaterial
This patch suppresses the outdated KX_PolygonMaterial.rst documentation file and moves the example contained in it into KX_BlenderMaterial.rst.
The file KX_BlenderMaterial.rst receives some extra formatting changes (lists are not supported in methods arguments types).

Reviewers: kupoman, campbellbarton, lordloki, panzergame, moguri

Reviewed By: panzergame, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1355
2015-06-17 22:43:29 +02:00
Campbell Barton
94eb2647d5 BGE: correct case for createConstraint keyword 2015-06-16 21:22:41 +10:00
Jorge Bernal
6d63446710 BGE: Fix for precision lost in setBackground/getBackground at Video Texture
Now internally the variables are processed as floats avoiding int->float->char conversions that are causing precision lost.

A check for int numbers is maintained to keep compatibility with old behaviour.

Reviewers: ben2610, campbellbarton, moguri, hg1

Reviewed By: moguri, hg1

Subscribers: campbellbarton

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1301
2015-06-16 00:05:25 +02:00
Porteries Tristan
1c707a2392 BGE: Fix T43918: adding submodule bge.app including attribute version.
This patch adds the submodule app to bge. apps contains constants similar to bpy.app, particularly version (tuple of three ints like 2.75.1).

It was requested in T43918 and set as TODO.

The patch also adds rst doc for the module.

Reviewers: moguri, kupoman, lordloki, panzergame, campbellbarton

Reviewed By: lordloki, panzergame, campbellbarton

Subscribers: marcino15

Projects: #game_logic, #game_python, #game_engine

Differential Revision: https://developer.blender.org/D1348
2015-06-15 21:46:56 +02:00
Mitchell Stokes
5aade17bdf Revert "BGE : KX_VertexProxy support for more than 2 UV channel."
This reverts commit fb0dd596e9a58f095730359a11759c40ea46be44.

This commit reintroduced a deprecated API that we'd rather not see in a
release. A better solution is being worked on.
2015-06-06 13:12:27 -07:00
Quentin Wenger
be4d34ca86 BGE Python API: Completing doc for bge.types.KX_FontObject
This adds description of the Font object and about its (only one)
attribute, as well as an example of use.

Reviewers: campbellbarton, fsiddi, dfelinto, moguri

Reviewed By: dfelinto

Subscribers: lordloki

Projects: #documentation, #game_engine

Differential Revision: https://developer.blender.org/D863
2015-05-27 17:18:43 +02:00
Thomas Szepe
093d11df35 BGE: Some changes for the constraint document
* Change the constraint type alignment to vertical.
* Changed PHY_CONE_TWIST_CONSTRAINT to the correct value.
* Some minor changes.
2015-05-20 18:49:18 +02:00
Thomas Szepe
2c5d5a9feb BGE: Remove chapter in KX_WorldInfo python API 2015-05-20 18:36:02 +02:00
Campbell Barton
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
Campbell Barton
922d5ed939 doxygen: update config 2015-05-20 14:09:43 +10:00
Campbell Barton
f0c143ca72 doxygen: rename included files (they were ignored) 2015-05-20 13:06:42 +10:00
Porteries Tristan
a1e8547877 BGE: Use CameCase code style for KX_WorldInfo python API. 2015-05-19 23:13:30 +02:00
Campbell Barton
847ec075eb Cleanup: pep8 2015-05-17 17:26:01 +10:00
Campbell Barton
34c78a659b Doc: add bpy.utils.previews
Updated sphinx_doc_gen.py to better handle pure py-classes.
2015-05-12 18:24:32 +10:00
Campbell Barton
f727df6076 Doc: correct rst syntax
also remove some API docs from example
2015-05-12 18:23:29 +10:00
Campbell Barton
8a231185aa Doc: minor fixes
- check for class/static methods assumed nonzero args.
- subclass references and set-flag items are now sorted.
- use 'order' for Py operator mix-ins,
  so operator settings don't show in random order.
2015-05-12 18:23:24 +10:00
Thomas Szepe
1c02a201ba BGE: Cleanup constraints documentation
* Fixing Python example. Behavior has changed with Blender 2.74
* Adding missing return type
* Fixing typo simbolic
* Fixing note for upper/lower limit
* Adding link to constraints constants
2015-05-10 15:58:17 +02:00
Porteries Tristan
fb0dd596e9 BGE : KX_VertexProxy support for more than 2 UV channel.
I have added an optional named "index" argument for methode get/setUV, I have also modified the and set to deprecated methodes setUV2 and getUV2 : the doc was wrong and the methode can't be called anyway because it declared as VARARG in the .h and convert directly the args value to a vector in the .cpp.

Reviewers: sybren, lordloki, hg1

Reviewed By: lordloki, hg1

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D1240
2015-05-06 22:55:46 +02:00
Sybren A. Stüvel
4e7ef3f5cd BGE: Added 'ghost' arg to KX_GameObject.suspendDynamics() method
The implementation of this 'ghost' argument already existed in the C++
source, but wasn't exposed to Python yet.
2015-05-04 12:04:09 +08:00
Porteries Tristan
5efbd2a407 BGE : addObject in python without reference object.
Making the reference argument optional for the addObject function.
```
scene.addObject("Cube")
```

This allows to keep the rotation, scale and position of the original object.
To avoid layer problems with lights if the reference arguments is None, the new object have the same layer than the active layers in scene.

Reviewers: lordloki, moguri, hg1, sybren

Reviewed By: hg1, sybren

Subscribers: agoose77

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1222
2015-04-26 16:29:58 +02:00
Ines Almeida
324751259e correcting typos in python api docs 2015-04-24 14:08:31 +01:00
Dalai Felinto
9425a8ff38 BGE: scene.pre_draw_setup[] callback
This callback allows the user to change the camera data right before the
rendering calculations.

scene.pre_draw[] is not enough here, because if you want to change the
camera matrices (projection/modelview) the culling test is done before
that (after pre_draw_setup[] though).

Reviewers: moguri, campbellbarton

Differential Revision: https://developer.blender.org/D1251

Python sample code using this. The sample scene would need a default
camera (not used for rendering), a dummy camera ('Camera.VR'), and two
cameras ('Camera.Left', 'Camera.Right') that will be used for the actual
rendering.

```
import bge

def callback():
    scene = bge.logic.getCurrentScene()
    objects = scene.objects

    vr_camera = objects.get('Camera.VR')

    if bge.render.getStereoEye() ==  bge.render.LEFT_EYE:
        camera = objects.get('Camera.Left')
    else:
        camera = objects.get('Camera.Right')

    vr_camera.worldOrientation = camera.worldOrientation
    vr_camera.worldPosition =  camera.worldPosition

def init():
    scene = bge.logic.getCurrentScene()
    main_camera = scene.active_camera
    main_camera.useViewport = True

   scene.pre_draw_setup.append(callback)

    objects = scene.objects
    vr_camera = objects.get('Camera.VR')
    vr_camera.useViewport = True
    vr_camera.setViewport(
            0,
            0,
            bge.render.getWindowWidth(),
            bge.render.getWindowHeight() )
```
2015-04-21 17:41:23 -03:00
Porteries Tristan
3d55859924 BGE: Support for collision group/mask from the api + activated on EndObject.
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1

EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.

Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.

Thanks to agoose77 for his help.

Reviewers: scorpion81, hg1, agoose77, sergof

Reviewed By: agoose77, sergof

Subscribers: sergof, moguri

Projects: #game_physics, #game_engine

Differential Revision: https://developer.blender.org/D1243
2015-04-19 01:04:22 +02:00
Jorge Bernal
8c98b1649d BGE: Fix for T42341 Sensor.frequency is badly named
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.

Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.

Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.

Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.

Thanks to Sybren for the investigation.

{F162440}

Reviewers: campbellbarton, sybren, moguri, hg1

Reviewed By: sybren, hg1

Differential Revision: https://developer.blender.org/D1229
2015-04-16 06:39:33 +02:00
Gaia Clary
6fbf05f326 Make python gotchas more clear (regarding handling of stale data) 2015-04-13 11:00:22 +02:00
Thomas Szepe
87b6d3c796 BGE: Add keyword arguments to createConstraint API
Added keyword arguments to createConstraint.
Changed initial values for the pivod XYZ  form 1 to 0.0.
Changed initial values for the axis Z form 1 to 0.0.
Delete the parsing for 4 parameters, because parsing only the X pivot is not necessary, also it was not working correctly (int instead of  float).

Reviewers: brita_, sybren, lordloki, campbellbarton, moguri

Reviewed By: lordloki, campbellbarton

Subscribers: campbellbarton

Differential Revision: https://developer.blender.org/D705
2015-04-11 16:17:07 +02:00
Campbell Barton
11a48b7227 Python API docs, don't hard-code sphinx themes
also set the theme to classic (as it was for 2.73)
2015-04-10 15:49:07 +10:00
Thomas Szepe
e36b0cb8f3 BGE: New API method getDisplayDimensions
This patch adds a new API function to get the actual display dimensions in pixels.

Reviewers: dfelinto, sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Differential Revision: https://developer.blender.org/D648
2015-04-07 18:32:25 +02:00
Sybren A. Stüvel
3e5332bb95 BGE: fixed nomenclature of KX_Scene::addObject and KX_Scene::AddReplicaObject
KX_Scene::addObject: Changed the parameter "other" to "reference", as "other" doesn't mean anything.
KX_Scene::AddReplicaObject: Changed the parameter "parentobject" to "referenceobject", as the parameter did NOT contain a parent object in any way.

Now both functions use the same kind of name for the same thing.

Thanks to panzergame / Porteries Tristan.
2015-04-06 17:11:36 +02:00
Campbell Barton
38c4645f0a rename BGE attr from D1091 (match methods) 2015-03-27 22:23:19 +11:00
Porteries Tristan
a12b2ec66d BGE: New isDynamicSuspended python attribute
This is a new KX_GameObject attribute that it increments the
possibilities of optimization during the game

Additionally the unused m_bSuspendDynamics variable is removed.

Reviewers: moguri, agoose77, lordloki

Reviewed By: agoose77, lordloki

Subscribers: agoose77, lordloki

Differential Revision: https://developer.blender.org/D1091
2015-03-27 06:11:23 +01:00
Ines Almeida
765fd7044b Updating python API documentation for function bge.render.makeScreenshot 2015-03-24 10:17:55 +00:00
Thomas Szepe
ee57968461 BGE: Remove old world bge.render API
This patch can be used to remove the old world bge.render API if the new world API D157 is used.

If  the new world API is applied we can remove the old API because the old has newer worked.
The patch keep the two old working methods for backward compatibility.

Reviewers: campbellbarton, moguri

Reviewed By: campbellbarton, moguri

Subscribers: brecht

Differential Revision: https://developer.blender.org/D158
2015-03-24 00:27:45 +01:00
Thomas Szepe
fd22a92939 BGE: Add new world API KX_WorldInfo (KX_Scene)
This Patch will add a the world API (mist, background, ambient)  to KX_WorldInfo.
The new API uses now attributes.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Subscribers: klauser, brecht

Differential Revision: https://developer.blender.org/D157
2015-03-24 00:23:40 +01:00
Thomas Szepe
d07c666a0e BGE: Add setMistType and setMistIntensity API.
This patch adds the missing setMistType() and setMistIntensity() to the API

Reviewers: campbellbarton, brecht, moguri

Reviewed By: campbellbarton, brecht, moguri

Subscribers: campbellbarton, dingto

Differential Revision: https://developer.blender.org/D149
2015-03-23 21:40:11 +01:00
Thomas Szepe
2affbb437b BGE: Multitexture world (mist, ambient) fix
This patch fix the existing word API for mist and global ambient lighting.
Add deprecated message to disableMist()
Add setUseMist(enable).

Reviewers: dfelinto, campbellbarton, moguri

Reviewed By: moguri

Subscribers: solarlune, jta, brecht

Projects: #bf_blender:_next

Differential Revision: https://developer.blender.org/D148
2015-03-23 21:36:08 +01:00
Pierluigi Grassi
225027ce5d BGE - new read-only attribute in KX_GameObject python api (LOD level)
Added a new "current_lod_level" property to the python api of
KX_GameObject. The property returns the current lod level of the game
object. The purpose of the property is activate logic routines only when
an object is at a certain lod-distance from the camera, avoiding to
separately recomputing the same distance in the logic script. Usage in
python script might look like:

owner = bge.logic.getCurrentController().owner
lod_level = owner.currentLodLevel
if lod_level == 0: ...do something
else: ... object might be too distant

Reviewers: dfelinto, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D978
2015-03-15 17:26:49 +01:00
Ines Almeida
f15bb2b793 doxygen: updating blender version and link to tracker 2015-02-21 12:16:20 +00:00
Ines Almeida
7501bdc52e python bge.types module - Updating documentation to close T40778 2015-02-21 12:16:20 +00:00
Ines Almeida
e0187ec0c3 Documentation update: references to OpenGL tutorials in the python bgl module 2015-02-21 12:16:19 +00:00
Sybren A. Stüvel
59c0a1e7c8 Typo fix + clarification in mathutils.Vector example 2015-02-10 21:25:01 +01:00
Ines Almeida
4edc1bbe02 BGE - Vehicle Controller - add background and API checks for arguments of function calls
Fixes T41570 crash
For readability, attachDir was renamed to downDir and the Python API docs renamed accordingly
2015-02-09 20:58:15 +00:00