Commit Graph

807 Commits

Author SHA1 Message Date
Porteries Tristan
23bdcfe560 BGE: Fix KX_LightObject python API documentation.
Replace "..attribute::" by ".. attribute::".
2016-05-15 14:56:40 +00:00
Campbell Barton
beaa57d269 Refactor BKE_blender into separate headers
- BKE_blender_version.h (only version defines & versionstr).
- BKE_blender_copybuffer.h (currently only used for view3d copy/paste).
- BKE_blender_undo.h (global undo functions).
- BKE_blendfile.h (high level blend file read/write API).
2016-04-25 19:27:45 +10:00
Bastien Montagne
0b349871d8 Fix T48212: Typos in bpy enum props examples. 2016-04-21 12:16:32 +02:00
Campbell Barton
e56e7bd1ec Add lib for n-dimensional cubic curve fitting
This will be used for calculating bezier curves from freehand drawing,
may be used for other areas too.

Original code from GraphicsGems, 1990 (FitCurve.c),
with updates from OpenToonz, under 3 clause BSD license.
with own minor modifications for integration with Blender:
- support adding extra custom-data.
- improved handle clamping.
2016-04-15 20:33:58 +10:00
Ines Almeida
7499fcf177 Python docs: minor cleanup and adding missing parenthesis to a code sample 2016-03-05 19:46:01 +00:00
Campbell Barton
9c8b6cc3fd Docs: include mathutils.interpolate 2016-03-04 08:40:22 +11:00
Campbell Barton
f38c175fc8 Docs: example for writing blend file libraries 2016-03-04 07:56:04 +11:00
Campbell Barton
3091935fec Docs: early exist build process on error
Don't attempt to build docs when generation fails.
2016-02-28 04:25:11 +11:00
Campbell Barton
c3a408938d Docs: Add missing context members 2016-02-28 04:25:11 +11:00
Ulysse Martin
608ee3e073 BGE: Allow access to original texture openGL Bind code/Id/Number
This patch adds a python method to get openGL bind code of material's texture according to the texture slot.

Example:
import bge

cont = bge.logic.getCurrentController()
own = cont.owner

bindId = own.meshes[0].materials[0].getTextureBindcode(0)
Test file: http://www.pasteall.org/blend/40679

This can be used to play with texture in openGL, for example, remove mipmap on the texture or play with all wrapping or filtering options.
And this can be used to learn openGL with Blender.

Reviewers: TwisterGE, kupoman, moguri, panzergame

Reviewed By: TwisterGE, kupoman, moguri, panzergame

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1804
2016-02-18 12:05:53 +01:00
Campbell Barton
318d3b9ab4 Cleanup: rst style 2016-02-15 19:43:08 +11:00
Campbell Barton
41fb953fa0 Docs: update tip on using the systems Python 2016-02-15 19:35:54 +11:00
Bastien Montagne
a9813f2380 Tweak doc section about overriding context - point out context.copy() usage! 2016-02-14 18:27:35 +01:00
Campbell Barton
1538f526e9 Docs: update doxy config 2016-02-14 22:11:35 +11:00
Campbell Barton
af49690b32 Docs: disable sharing docs within a group
This made using groups apply docstrings to undocumented functions in the group
(and give errors that the args didnt match).
2016-02-14 22:10:42 +11:00
Campbell Barton
33fb344171 Docs: remove bmesh py api warning 2016-02-13 20:44:47 +11:00
Campbell Barton
37a2a3c8dc Fix RenderEngine API docs
Correct access to passes, D1779 by @levon.

Also use is_preview attr and use register/unregister functions.
2016-02-08 20:35:32 +11:00
Campbell Barton
d924998d3e Cleanup: pep8 2016-02-01 00:47:10 +11:00
Campbell Barton
0f3f117311 Docs: add preset menu example 2016-01-31 18:08:01 +11:00
Campbell Barton
4a0b896671 Minor correction to API docs 2016-01-27 07:51:53 +11:00
Campbell Barton
4f8b7f4420 Docs: quiet warnings in reference doc syntax 2016-01-25 20:26:39 +11:00
Campbell Barton
f233770ef8 Docs: avoid plank comma in API reference 2016-01-25 20:26:39 +11:00
Ulysse Martin
c4c2bd1350 BGE: Allow access to light shadow settings with python
This patch adds a new API which allow us to access light shadow settings from python. The new API can be used to write custom GLSL materials with shadows.

Reviewers: brecht, kupoman, agoose77, panzergame, campbellbarton, moguri, hg1

Reviewed By: agoose77, panzergame, campbellbarton, moguri, hg1

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1690
2016-01-17 18:47:14 +01: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
Arnaud Degroote
aae93ae4c6 BGE: Improve clock management
This patch improves clock management in BGE, to be able to accelerate /
slow the time, and also to finely synchronize clock with external
engines. Several new python functions have been added and existence ones
have been improved for that purpose. Now we have:

- getClockTime(): Get the current BGE render time, in seconds. The BGE
render time is the simulation time corresponding to the next scene that
will be rendered.

- getFrameTime(): Get the current BGE frame time, in seconds. The BGE
frame time is the simulation time corresponding to the current call of
the logic system. Generally speaking, it is what the user is interested
in.

- getRealTime(): Get the number of real (system-clock) seconds elapsed
since the beginning of the simulation.

- getTimeScale(): Get the time multiplier between real-time and
simulation time. The default value is 1.0. A value greater than 1.0
means that the simulation is going faster than real-time, a value lower
than 1.0 means that the simulation is going slower than real-time.

- setTimeScale(time_scale): Set the time multiplier between real-time
and simulation time. A value greater than 1.0 means that the simulation
is going faster than real-time, a value lower than 1.0 means that the
simulation is going slower than real-time. Note that a too large value
may lead to some physics instabilities.

- getUseExternalClock(): Get if the BGE use the inner BGE clock, or rely
or on an external clock. The default is to use the inner BGE clock.

- setUseExternalClock(use_external_clock): Set if the BGE use the inner
BGE clock, or rely or on an external clock. If the user selects the use
of an external clock, he should call regularly the setClockTime method.

- setClockTime(new_time): Set the next value of the simulation clock. It
is preferable to use this method from a custom main function in python,
as calling it in the logic block can easily lead to a blocked system (if
the time does not advance enough to run at least the next logic step).

Rationale are described more precisely in the thread
http://lists.blender.org/pipermail/bf-gamedev/2013-November/000165.html.

See also T37640

Reviewers: sybren, panzergame, #game_engine, lordloki, moguri

Reviewed By: sybren, panzergame, #game_engine, lordloki, moguri

Subscribers: moguri, hg1, sybren, panzergame, dfelinto, lordloki

Projects: #game_engine

Maniphest Tasks: T37640

Differential Revision: https://developer.blender.org/D728
2015-12-12 02:46:53 +01:00
f9047c3f8c Eigen: fold remaining OpenNL code into intern/eigen.
Differential Revision: https://developer.blender.org/D1662
2015-12-10 01:58:10 +01:00
Campbell Barton
3c1b00ef7e Docs: create link pointing to latest API docs 2015-11-11 04:14:11 +11:00
Campbell Barton
41e267b4b4 API Docs: use importlib in examples 2015-11-05 19:08:17 +11:00
Porteries Tristan
f29f4c92f2 BGE: Remove KX_IPOActuator.
KX_IPOActuator is not used since 2.4.

This patch removes:
	- KX_IPOActuator.h/cpp;
	- Python doc;
	- Write of IPO actuator in write.c;
	- Allocation of IPOactuator in sca.c;
	- Conversion in KX_ConvertActuators.cpp;
	- Initialization of the python proxy in KX_PythonInitTypes.cpp;
	- Other minor remove in logic_windows.c and in KX_PythonInit.cpp.

Reviewers: sybren, campbellbarton

Reviewed By: campbellbarton

Subscribers: moguri

Differential Revision: https://developer.blender.org/D1603
2015-11-03 10:31:08 +01:00
Campbell Barton
d1e18c35d3 Docs: support alternate binary path for PyAPI 2015-10-28 23:30:37 +11:00
Porteries Tristan
06d2ad0185 BGE: Fix issues with async libload.
This patch fixes:
- the call of LibFree on a unfinished loaded library;
- memory leak created on end of game : the async libraries are loaded but not converted, so not freed with the master scene.

Reviewers: campbellbarton, sybren, youle, hg1, moguri, lordloki

Reviewed By: moguri, lordloki

Differential Revision: https://developer.blender.org/D1571
2015-10-25 19:22:29 +01:00
Dalai Felinto
0173116117 New function to draw offscreen, and related API changes
This expose the capability of handling offscreen drawing. The initial
support lays the barebones for addons to work with framebuffer objects
and implement 3d viewport offscreen drawing. This can be used by script
writers to make fisheye lens preview, head mounted display support, ...

The complete documentation is here: http://www.blender.org/api/blender_python_api_2_76_1/gpu.offscreen.html

Review and many changes by Campbell Barton (thank you :)

https://developer.blender.org/D1533
2015-10-20 01:15:03 -02:00
Campbell Barton
38cd6329d6 Py API docs: fix extracting bmesh.ops from C code. 2015-10-20 03:55:31 +11:00
Campbell Barton
e60d535443 3D View: support non-uniform scaled lamps
D1378 by @youle

Non-uniform scaled lamps now cast oval/rectangular shadows, viewport & BGE.
2015-10-15 22:36:31 +11:00
Thomas Szepe
bd6febc4c4 BGE: Change KX_WolrdInfo mathutils vector to color
Change the mathutils callback from vector to color for mistColor, backgroundColor and ambientColor.

Reviewers: lordloki, campbellbarton, panzergame, moguri, sybren

Reviewed By: panzergame, moguri, sybren

Projects: #game_engine, #game_logic

Differential Revision: https://developer.blender.org/D1432
2015-10-11 18:43:05 +02:00
Thomas Szepe
83721682bb BGE: Change character jumping to char
* Change the character jumping variables and methods from int to char.
* Limit the maxJumps integer value from 0 to 255.
* Allow to set the minimum jump amount to 0.

Reviewers: panzergame, lordloki, moguri

Reviewed By: lordloki, moguri

Subscribers: agoose77

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1305
2015-10-11 15:41:40 +02:00
Porteries Tristan
720d4521cd BGE : Collision mask support in raycast + and raycast cleanup.
I have removed the m_pHitObject, m_xray and m_testPropName and replace them by a temporary struct "RayCastData" which contains these datas and a collision mask. Finally i add a collision mask argument in the python function "rayCast" :
```
rayCast(to, from, dist, prop, face, xray, poly, mask)
```

It can be useful to hit only object which are on the right colision layer. for example if you have hitbox for a charater or vehicle you don't want to hit it with raycast.

test file : {F237337}
left mouse click on two planes and see console messages.

Somewhat more elaborate test file by @sybren: {F237779}
Look around and click on the cubes. One cube lamp responds, the other doesn't, based on their collision groups.

Reviewers: moguri, hg1, agoose77, campbellbarton, sybren

Reviewed By: agoose77, campbellbarton, sybren

Subscribers: campbellbarton, sergey, blueprintrandom, sybren

Projects: #game_engine, #game_physics

Differential Revision: https://developer.blender.org/D1239
2015-10-07 22:14:43 +02:00
Sybren A. Stüvel
1a6d45527f BGE docs fix: link to the correct method name 2015-09-27 17:20:10 +02:00
Sybren A. Stüvel
8ea5cfd448 BGE documentation updates
Mostly added missing :arg: clauses -- these caused the :type:-clauses
that were already in the RST files to be hidden from the output HTML.

I also fixed some argument types from 'list' to 'Vector' where applicable
and corrected some obvious mistakes.
2015-09-27 16:32:16 +02:00
Campbell Barton
208e064721 Doc: escape enum name & description
Needed since key enum now uses many characters as they're typed.
2015-09-18 01:47:58 +10:00
Campbell Barton
f184202a9a Cleanup: API docs 2015-09-08 19:42:58 +10:00
Campbell Barton
77b0b661dd Doc: PyAPI docs, quiet warnings, fix URL's 2015-09-07 18:23:16 +10:00
Campbell Barton
1c5b15eab3 Doc: update Python 'gpu' module reference
- add missing uniforms.
- add uniform types.
- link to RNA equivalent.
- remove 'value' from uniforms (they were wrong, better use module members anyway).
- various corrections & edits.

Fixes T45505
2015-09-07 16:11:05 +10:00
Campbell Barton
e709da3def Cleanup: minor RST edits 2015-09-04 01:11:26 +10:00
Sybren A. Stüvel
2c2f075929 BGE docs: resolution & fullscreen changes don't work in the embedded player
The documentation for bge.render.{setWindowSize,setFullScreen,getFullScreen}
did not mention that those functions are no-ops when using the Blender-
embedded player.
2015-09-03 15:05:36 +02:00
Sybren A. Stüvel
ba5807c271 BGE: added bge.logic.{get,set}AnimRecordFrame functions
By using getAnimRecordFrame(), game developers have access to the frame
number used by the "Record animation" feature. This enables them to
record additional information in Blender's F-Curves and ensuring perfect
synchronization with the information already recorded by Blender.

The setAnimRecordFrame() can be used to change the frame number at which
animations are recorded, for example to introduce delays the recording that
do not require delays in the actual game/simulation run.

The getter/setter functions in KX_KetsjiEngine are not directly named after
property they access (m_currentFrame). I found "current frame" to be too
vague for a public interface, hence chose a more descriptive name.

Reviewers: moguri, hg1, campbellbarton, panzergame, aligorith

Reviewed By: panzergame, aligorith

Differential Revision: https://developer.blender.org/D1449
2015-08-25 13:42:09 +02:00
Campbell Barton
ac62d44e4f Docs: function comments 2015-08-18 07:11:55 +10:00
Sybren A. Stüvel
d4a9da28e8 Doc fix: rather then -> rather than 2015-08-05 12:48:04 +02:00
Mateo de Mayo
23f54076db BGE: Added getActionName() function to KX_GameObject()
It works similar to getActionFrame(), you have to give a layer or not (for layer 0) as the argument and it returns the name of the animation that the object is currently playing.

Example:

```
import bge
own = bge.logic.getCurrentController().owner
own.playAction("SomeAction",0,20)
print(own.getActionName())
```
>> SomeAction

Here is an example file, just open the blend file with the terminal opened
and press P, you can see how the current animation is being printed:
{F217484}

Reviewers: moguri, hg1, panzergame, campbellbarton

Reviewed By: panzergame

Subscribers: campbellbarton, hg1, #game_engine

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1443
2015-08-04 00:10:33 +02:00
Campbell Barton
2904007d31 Docs: Python API, minor edits to download link 2015-08-01 20:10:25 +10:00
Campbell Barton
49f88326af Docs: doxy cleanup/minor edits 2015-08-01 12:37:52 +10:00
Campbell Barton
18af73e461 Add mathutils.bvhtree API
Originally D966 by @lukastoenne, with own additions

- trees can be initialized from Object's, BMesh,
  or passed in as vert+polygon arrays.
- original indices of ngons/faces are used. (instead of tessellated indices).
- ray_cast, find_nearest methods
- find overlapping faces between 2 trees
2015-07-29 21:24:12 +10:00
Sybren A. Stüvel
40a866dad4 Doc fix: wolrd -> world
The documentation for bge.types.KX_WorldInfo had two typos.
2015-07-27 15:53:15 +02:00
Sybren A. Stüvel
ec8b7edf53 Fix: solved issue with "make doc_py"
The error was "ValueError: Function <function normal_at_I0D at 0x7f2aad1feb70>
has keyword-only arguments or annotations, use getfullargspec() API which can
support them", and was first seen in eeeb845d33e81afbc8ed127e6ab4ae7b18472a54
2015-07-22 10:31:31 +02:00
Campbell Barton
532b735ee8 Docs; Py API gotcha's section
Minor corrections and cleanup
2015-07-12 20:50:44 +10:00
Campbell Barton
1d021956f5 Remove redundant lists, link instead 2015-07-07 21:25:51 +10:00
Campbell Barton
86f09e58d4 Remove unnecessary constant info
Noting every constant as an int isnt helping,
this is only meant to be passed to only.
2015-07-07 21:17:33 +10:00
Quentin Wenger
6ed1a1abe2 BGE: bge.texture API documentation enhancement
This patch attempts to improve and review the documentation of bge.texture, as requested in the [[ http://wiki.blender.org/index.php/Dev:2.5/Source/Development/Todo/GameEngine#Video_Texture | TODO list ]].

More specifically, it

  - fixes the rst syntax, including titles of the examples bge.texture.py and bge.texture.1.py;

  - adds, standardizes and reviews description of the API elements, particularly signatures, types, etc.

  - adds SOURCE_* constants to the doc

  - splits the doc into thematical parts (Video, Image, Texture, and Filter Classes, Functions, Constants).

Notes:

  - The parameter "mode" of ImageBuff.plot has to be described better. Actually, the whole set of IMB_BLEND_* constants (from IMB_imbuf.h) should be exposed to Python. I'll do that in a future diff, and complete the doc at the same moment (adding those IMB_BLEND_* constants to the Constants part of this doc).

  - The option of using webcams in VideoFFmpeg is still particularly not well documented. I am planning to make a proposal about fixing T18634 (and its corresponding TODO in the list) by integrating OpenCV in the BGE (and Blender?). The idea would then probably be to add a new class, f.ex. ImageWebcam, making this functionnality more specialized. So for now I don't think it is worth to document that part much.

This patch fixes T44284 too.

Reviewers: moguri, kupoman, campbellbarton, panzergame, lordloki

Reviewed By: panzergame, lordloki

Subscribers: hg1

Projects: #game_engine, #game_python, #documentation

Maniphest Tasks: T44284

Differential Revision: https://developer.blender.org/D1352
2015-07-06 21:48:25 +02:00
Porteries Tristan
145ab8c49e BGE: Extend Python API for KX_BlenderMaterial (specular, diffuse…)
Add support for material diffuse, specular… in KX_BlenderMaterial python proxy. And use mathutils in KX_BlenderMaterial for the specular and diffuse color in KX_BlenderMaterial.

Reviewers: sybren, brita_, kupoman, agoose77, dfelinto, moguri, campbellbarton, hg1

Reviewed By: moguri, campbellbarton, hg1

Subscribers: dfelinto

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1298
2015-07-03 11:47:48 +02:00
Dalai Felinto
fdb474fc8a Game Engine: Camera Lens Shift: support to change it during game 2015-07-02 13:51:30 -03:00
Porteries Tristan
0e084f93d9 BGE: Remove KX_PolygonMaterial reference in documentation. 2015-07-01 14:56:02 +02:00
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
Sybren A. Stüvel
dd65a44c9a BGE physics: When colliding, report first contact point to Python
This patch adds two parameters to the functions in the
collisionCallbacks list. The callback function should thus be like
this:

```
def on_colliding(other, point, normal):
    print("Colliding with %s at %s with normal %s" % (other, point, normal))

game_ob.collisionCallbacks.append(on_colliding)
```

The `point` parameter will contain the collision point in world
coordinates on the current object, and the `normal` contains the
surface normal at the collision point.

The callback functions are checked for the number of arguments
`co_argcount`. The new `point` and `normal` arguments are only passed
when `co_argcount > 1` or when `co_argcount` cannot be determined.

Reviewers: brita_, campbellbarton

Subscribers: sergey, sybren, agoose77

Projects: #game_physics

Differential Revision: https://developer.blender.org/D926
2015-02-08 15:52:13 +01:00
Sybren A. Stüvel
2e6e92cf50 Documentation: Support documenting constructors in class __doc__
Python types defined in C can now start their docstring with a
`.. class:: TypeName(args)` line, to document their constructor.
In that case the documentation writer is responsible for indenting the
remainder of the docstring by 3 spaces, matching the generated
documentation.
2015-02-01 14:00:43 +01:00
Sybren A. Stüvel
9fa628f35b mathutils: added exponential map to Quaternion
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.

Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.

Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.

Reviewers: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1049
2015-02-01 13:06:00 +01:00
Campbell Barton
65574b0b03 cleanup: shebang lines
D888 by @sambler
2015-01-29 15:56:23 +11:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Sergey Sharybin
424100cecb Update scons build documentation
- fix dead blender.org link (build dependencies)
  - rewrite $BLENDERHOME/{config,tools}/* to $BLENDERHOME/build_files/scons/{config,tools}/*

Patch by David Creswick, thanks!

Reviewers: jesterking

Differential Revision: https://developer.blender.org/D798
2015-01-28 23:40:41 +05:00
Dalai Felinto
5c6ef95b71 Docs: touch ups in the bge.render doc introduction 2015-01-22 03:20:39 -02:00
Dalai Felinto
8ed439b89e bge.render.getStereoEye() and bge.types.LEFT_EYE/RIGHT_EYE
This function allows the user to run specific code for each of the
rendered stereoscopic eyes in the Game Engine.

The initial use case is to set the camera projection matrix in
a scene.pre_draw callback function for each eye, to be used in VR
(Virtual Reality) installations.

Reviewed by Mitchell Stokes and Campbell Barton, thank you guys.

Sample Test Python Script:
"""
import bge
import bgl
import blf

def init():
    """init function - runs once"""
    scene = bge.logic.getCurrentScene()
    scene.post_draw.append(write)

def write():
    """write on screen - depending on the eye"""
    width = bge.render.getWindowWidth()
    height = bge.render.getWindowHeight()

    # OpenGL setup
    bgl.glMatrixMode(bgl.GL_PROJECTION)
    bgl.glLoadIdentity()
    bgl.gluOrtho2D(0, width, 0, height)
    bgl.glMatrixMode(bgl.GL_MODELVIEW)
    bgl.glLoadIdentity()

    eye = bge.render.getStereoEye()

    if eye == bge.render.LEFT_EYE:
        blf.position(0, (width * 0.2), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Left")

    else: # bge.render.RIGHT_EYE:
        blf.position(0, (width * 0.7), (height * 0.3), 0)
        blf.size(0, 40, 72)
        blf.draw(0, "Right")
"""
2015-01-22 03:00:24 -02:00
Sybren A. Stüvel
ecc58da8f1 Documentation: fixed documented types to match actual types
The BGE API uses Vectors, but often this was documented as list.

Maniphest Tasks: T43240

Differential Revision: https://developer.blender.org/D1006
2015-01-18 11:08:33 +01:00
Sybren A. Stüvel
ed8dc78691 BGE physics: get/set linear and angular damping
This patch adds the following R/W properties and method to `KX_GameObject`:

  - `linearDamping`  -- get/set linear damping
  - `angluarDamping`  -- get/set angular damping
  - `setDamping(linear, angular)` -- set both simultaneously

These allow runtime changes to the same properties that are accessible at design time in Blender's UI via `game.damping` and `game.rotation_damping`. The names of the properties were chosen to mirror the internal names of the BGE physics engine, as these are (AFAIK) also the commonly used names in physics literature.

Reviewers: campbellbarton

Projects: #game_physics

Differential Revision: https://developer.blender.org/D936
2015-01-15 18:37:22 +01:00
Campbell Barton
7c53c3483c PyAPI docs: minor changes to sphinx docs. 2015-01-08 03:55:01 +11:00
Campbell Barton
51a66a5a6e fix for doc generator 2014-12-29 22:16:44 +11:00
Campbell Barton
e7cb4d2a0d API Docs: remove hardcoded self from shellscript 2014-11-26 20:24:04 +01:00
Campbell Barton
d35d9e6452 update dna exporter for API changes
also print html name.
2014-11-14 00:55:40 +01:00
Campbell Barton
61f86a7bee Sphinx doc script: server path has changed 2014-11-10 19:28:22 +01:00
Bastien Montagne
e5c13aebea Fix T42372: demo addon in doc was not handling keymaps correctly during (un)registration.
First, you should unregister in reverse order you registered your operators, keymaps, etc.
Second, when registering keymaps you have to check keyconfigs are actually available (they are not in background mode).
2014-10-26 10:01:03 +01:00
Campbell Barton
d87add8ebb Sphinx doc script, update for change in rsync 2014-09-24 12:51:22 +10:00
Campbell Barton
90f75b8ce0 Cleanup: use static sets where possible 2014-09-18 17:45:31 +10:00
Tamito Kajiyama
cf0ce0afc7 Fix for a run-time error in sphinx_doc_gen.py on Windows. 2014-09-18 15:48:17 +09:00
Tamito Kajiyama
f87ca5f1c3 Fix for missing Freestyle sections in the Blender Python API documentation.
Freestyle sections of the API docs were empty due to Freestyle module reorganization
in commit rB6498b96ce7081db039354228213d72e8c70bd3aa.

Module __all__ property was added to submodules so as to properly exclude irrelevant
documentation elements such as mathutils.Vector.
2014-09-18 15:48:15 +09:00
Campbell Barton
0e0e528ea4 Cleanup: pep8 2014-09-17 18:36:17 +10:00
Campbell Barton
13c5b0d546 Utility script to create release archive
- only include files known to git.
- includes all submodules.
- version extracted from BKE_blender.h for naming.
- MD5 checksum generated.
- 'make tbz' convenience target.

Script by Dan McGrath with own minor edits.
2014-09-16 11:44:00 +10:00
Ines Almeida
1c9b80320f typo correction in the python API 2014-09-13 23:43:28 +02:00
Campbell Barton
4dd74706ab Add flag for bmesh docs 2014-09-09 22:07:31 +10:00
Benoit Bolsee
fb49c5aa56 BGE: fix crash and return boolean on scene.replace()
Scene replacement with invalid scene name was crashing blender,
now it's a no-op.
KS_Scene.replace() to return a boolean to indicate if the scene
is valid and is scheduled for replacement. This allows more
robust game management.
2014-08-23 12:31:32 +02:00
Campbell Barton
5d5b0db724 API Docs: typos 2014-08-06 02:12:52 +10:00
HG1
8f947ff34a BGE: Constraint wrapper fix.
1. This patch fix the KX_ConstraintWrapper documentation (radian instead of degrees).
2. It also adds the missing GENERIC_6DOF_CONSTRAINT constant.

Reviewers: dfelinto

Reviewed By: dfelinto

Differential Revision: https://developer.blender.org/D672
2014-07-29 00:22:13 -03:00
Campbell Barton
200dd87de1 Cleanup: pep8 & redundant vars 2014-07-22 12:03:15 +10:00
Mitchell Stokes
7307973063 BGE: Add property/material detection and X-Ray for mouse over any sensor
This patch adds a Property/Material detection and a X-Ray mode to the mouse over any sensor like on the ray sensor.

Proposal:
http://blenderartists.org/forum/showthread.php?261847-BGE-proposal-Mouse-Over-Any-sensor-with-Property-and-X-Ray&highlight=proposal

Reviewers: moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D653
2014-07-17 23:00:30 -07:00
HG1
841ade32be BGE: Add missing documentation and attribute constraint_type for ConstraintWrapper
1. Add attribute to get the constraint type.
2. Add missing documentation for getParent, setParam, constraint_id in bge.types.KX_ConstraintWrapper.rst.
3. Add missing documentation for GENERIC_6DOF_CONSTRAINT and flag bit in bge.constraints.rst.
4. Fix typo in CcdPhysicsEnvironment.cpp

Reviewers: moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D654
2014-07-17 22:52:23 -07:00
Jorge Bernal
1bf87fa26c BGE: TrackTo actuator: increasing up & track axis options
This is related to Task T34861 to increase up & track axis options for TrackTo actuator. I've just added it to differential to facilitate an easier review.

With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis.

Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library.

The wiki docs are here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator).

Test file is here: {F97623}

I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator:

{F91992} {F91990}

Reviewers: moguri, dfelinto

Reviewed By: moguri

CC: Genome36

Differential Revision: https://developer.blender.org/D565
2014-07-14 18:30:27 -07:00
HG1
984d6c8677 BGE debug API and actuator
This patch adds some new debug methods to the KX_GameObject for manually adding the debug list and bge.render for controlling the debug visualization.
It also adds a new debug actuator, which allows to control the same functions.

This patch is a updated version of T33701.

Thread on Blenderartists:
http://blenderartists.org/forum/showthread.php?264745-Debug-proerties-for-added-objects-patch&p=2256018&viewfull=1#post2256018

Reviewers: moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D635
2014-07-11 16:00:14 -07:00
Jorge Bernal
1f43b083a9 BGE: Fix for applyImpulse function
This is related to task T29419. Credit also goes to Goran Milovanovic
(goran) for proposing an initial fix for this issue.

The issue is the current behavior of applyImpulse doesn't match the behavior
described in the documentation as instead of a impulse point in world coordinates,
it seems to require a coordinate in a local space.

Additionally, applyImpulse function isn't consistent with similar functions (applyForce, applyTorque, etc)
as it doesn't allow  to choose in which space (local or global) the impulse is applied.

Now, we have the following function:

applyImpulse(point, impulse, local=False)
being "point" the point to apply the impulse to (in world or local coordinates). When local is False will
have both point and impulse in World space and when local is True will have point and impulse in local space.

Reviewers: moguri, dfelinto, brita_

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D567
2014-07-07 08:06:39 -07:00
Jorge Bernal
7d99a4ded9 BGE: New Mouse Actuator
Disclaimer: The author of this patch is Geoffrey Gollmer (gomer). I only updated the patch to the current git master status, reworked several parts to fit well with current coding style and applied several fixes.

This actuator allows users to show/hide the mouse cursor using logic bricks, as well as control object rotation with a mouse in the BGE.
The mouse rotation is flexible enough to allow any type of mouse look, as well as banking for flight controls.

{F94520}

{F91859}

Blend file for testing Mouse actuator (with default parameters and crosshair): {F94920}

Reviewers: moguri

Reviewed By: moguri

CC: gomer, lordodin

Differential Revision: https://developer.blender.org/D559
2014-06-25 15:47:37 -07:00
Campbell Barton
fc1040cc47 Fix example 2014-06-25 03:04:53 +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
cb7915fc60 Automatically generate blender.1 man page during build process
Patch T40418 by Lawrence D'Oliveiro
2014-06-14 01:19:58 +10:00
Campbell Barton
ba1acec6bc bgl API docs: link to OpenGL 2.0 reference
D538 by codemanx
2014-05-20 09:49:30 +10:00
Campbell Barton
8841ed84c9 Add missing context member for doc gen 2014-05-08 13:55:05 +10:00
Campbell Barton
a15be34389 Code cleanup: unused python vars & imports
Use frosted rather then pyflakes
2014-04-25 05:36:16 +10:00
Campbell Barton
ea610e655c Style cleanup: C & pep8 2014-04-15 13:11:48 +10:00
Campbell Barton
f38331adef Code cleanup: style 2014-04-03 09:24:09 +11:00
Mitchell Stokes
11299f5ff4 BGE doc cleanup: Some small cleanups in the BGE docs:
* Fixing trailing whitespace in some files
  * Fixing some indentation
  * SCA_PythonController.owner is now documented
  * SCA_PythonKeyboard members now use the member directive instead of function
2014-03-31 22:22:04 -07:00
Campbell Barton
f56a74566a Bump version to Blender2.70rc and new splash
Splash concept art & paint-over: David Revoy. 3D artwork by Mathieu Auvray.
2014-03-06 04:40:49 +11:00
Campbell Barton
767ac65e75 Docs: update man page script based on D251 2014-02-20 20:11:03 +11:00
e1d9308616 Fix T38629: broken links to OpenGL docs from python API docs. 2014-02-14 15:17:36 +01:00
Campbell Barton
aea00c7a81 Code cleanup: style 2014-02-13 08:52:12 +11:00
Campbell Barton
1c29fd77d3 Code Cleanup: style and correct API class ref 2014-01-26 22:17:01 +11:00
Dalai Felinto
67f1fd25ee game engine: implement hitMaterial for collision and ray sensors
Reviewed By: moguri, kupoman

Differential Revision: https://developer.blender.org/D167
2014-01-24 02:10:45 -02:00
Campbell Barton
a97180046b Fix bash/ksh specific test syntax
[ foo = bar ] has been the traditional compare operator, using == is supported by some shells, but not all. The latter offers no advantage over the former.

Differential Revision: https://developer.blender.org/D179
2014-01-07 14:12:02 +11:00
Campbell Barton
4848f9029a Patch D133: Python wrapper for BLI_kdtree (adds mathutils.kdtree)
Originally by Dan Eicher, with my own fixes and adjustments (see patch page for details).

For details there are unit tests and api example usage.

	doc/python_api/sphinx-in-tmp/menu_id.png
2014-01-06 20:32:34 +11:00
Thomas Dinges
f345414b89 Fix T38032, typo in Python API documentation. 2014-01-03 02:28:21 +01:00
Campbell Barton
81b64e506f API Docs: use a simpler example for merging namespaces 2013-12-27 14:21:03 +11:00
Campbell Barton
f9a323f836 Syntax correction for gpu docs, D124 2013-12-23 17:24:23 +11:00
James Yonan
1831c930a5 Game Engine: Option to record static objects animation 2013-12-09 22:28:38 +11:00
Campbell Barton
75212f4677 BMesh Py API: add bmesh.geometry.intersect_face_point()
patch originally by mont29 with some edits.
2013-12-06 21:15:56 +11:00
Campbell Barton
f85ccedb93 Python API Docs: update for using git buildinfo and change upload URL 2013-11-29 10:00:57 +11:00
Bastien Montagne
4c52e737df Add ctrl-click rename to most lists in Blender UI and templates/examples.
Notes:
* Did not touch to addons, that's up to the authors. ;)
* Did not removed any "name" field below lists. We might want to do this in some cases (less UI clutter), but probably not always, so will let maintainers of the related areas decide here.
2013-11-23 20:54:32 +01:00
Ton Roosendaal
c72dc45bcb And here is the first git (testing) commit by me!
Welcome to a brave new GPL3 world... well if commit works :)
2013-11-16 12:00:42 +01:00
Campbell Barton
39593b9b11 sphinx docgen wasn't including example scripts for python methods of RNA types. 2013-10-15 05:55:51 +00:00
Bastien Montagne
a6789a7f2e Fix broken example, reported by Codemanx on IRC, thanks. 2013-09-29 14:57:47 +00:00
Campbell Barton
b6631b8be7 fixes for python api docs.
also move foreach_get/set examples into their own py example files (prefer not to have example code built into blenders binary).
2013-09-18 05:20:43 +00:00
Mitchell Stokes
6365678109 BGE: Adding a Python collision API. The initial patch was provided by agoose77, with some edits by me.
KX_GameObject now has a collisionCallbacks list which is a list of callables that are called when a collision occurs. The callables will be called with an argument that contains a reference to the other object involved in the collision (i.e., not self).
2013-09-14 02:02:58 +00:00
Bastien Montagne
b7e2cd5948 UIList: update examples and templates. 2013-08-29 13:34:36 +00:00
Mitchell Stokes
9afae77fed BGE: Finally adding support for additive layer blending.
Currently this is only for the Python API. The logic brick will be updated in a future commit.
2013-08-14 23:31:49 +00:00
Mitchell Stokes
851627f6e0 BGE: Updating the bge.logic.expandPath() documentation to better reflect its current behavior. 2013-08-13 07:48:07 +00:00
Daniel Stokes
29c8e4512c Adding a fov attribute to KX_Camera. This attribute converts the field of view value and uses it to set lens. 2013-08-07 05:24:47 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Campbell Barton
905cb1639a update doxygen congfig and tweaks to warnings when running doxygen. 2013-07-03 04:47:50 +00:00
Campbell Barton
3ff36f928c 3d text tool - 'insert lorem' was crashing, also add this to the text menu. 2013-06-27 04:18:01 +00:00
Campbell Barton
4f6f24752b correct example [#35850] documentation error for mathutils.Vector 2013-06-23 19:04:12 +00:00
Brecht Van Lommel
860fce4eb9 Code cleanup: removed some unused UI button types
* CHARTAB: not needed anymore with improved copy/paste support and text input.
* IDPOIN: replaced by SEARCH_MENU.
* ICONROW/ICONTEXTROW: replaced by RNA enums.
* NUMABS: can use min/max limits instead.
* BUT_TOGDUAL, TOG3, TOGR, SLI: not used in 2.5 interface.
2013-06-09 18:05:50 +00:00
Campbell Barton
2d4a682a8e add popup menu to allow python scripts to show popups without having to define a menu class first. 2013-06-01 04:06:38 +00:00
Campbell Barton
f3ad5bd3ff rename references to faces in docs. 2013-05-28 13:58:56 +00:00
Campbell Barton
7222d654b2 code cleanup: typo and stop manpage turning '$' into italic. 2013-05-25 02:21:50 +00:00
Bastien Montagne
6fc51bf20e Moved main part of bpy.app.translations doc out of C code, as suggested by Campell, thx. 2013-05-14 18:16:37 +00:00
Campbell Barton
8771a9f861 update autogenerated changelog. also correct typos in the generator. 2013-05-09 01:58:49 +00:00
Brecht Van Lommel
02fd2d256d Fix #35216: code examples like simple operator missing from python docs due to
rename of directory.
2013-05-05 05:56:48 +00:00
Campbell Barton
93e3107806 select loose wasn't working very usefully if you only wanted to select loose verts, now select loose verts/edges/faces depending on the selection mode. 2013-04-29 16:59:53 +00:00
Campbell Barton
9a269f3a1f update sphinx docgen
was missing context property attributes - context.mode for example. add RNA properties into context docs.

also minor updates
- exclude freestyle if its not enabled.
- add missing context member.
2013-04-29 16:20:49 +00:00
Bastien Montagne
eaf1e7a888 Py API doc generation: add bpy.app.translations module, and fix a few errors found while building the doc. Thanks to Campbell for review. 2013-04-19 13:00:21 +00:00
Mitchell Stokes
d2b14ed4f0 BGE: Adding mipmapping control to bge.render via bge.render.setMipmapping() and bge.render.getMipmapping(). 2013-04-14 00:40:24 +00:00
Mitchell Stokes
dbf4328f3f BGE: Adding a render.setFullScreen() and a render.getFullScreen() to allow fulscreening games via Python. 2013-04-13 21:09:02 +00:00
Campbell Barton
eb495b2a8a use lowercase name for freestyle module (as with all other blender modules). 2013-04-07 11:22:54 +00:00
Tamito Kajiyama
4c42f5c8a9 Missing updates in the doc/ and intern/ folders during the merger in revision 55847. 2013-04-07 06:56:49 +00:00
Brecht Van Lommel
d579ea2901 Fix #34863: bge.render.makeScreenshot from Blender was only saving PNG files,
while the docs said it followed the settings in the Output panel, other file
formats work now.

Benderplayer still only saves PNG now as documented, but I cleaned up the code
there to reuse existing imbuf functions rather than using own libpng code.
2013-04-04 14:00:31 +00:00
Mitchell Stokes
460d21af6f BGE: Adding docs for bge.logic.getProfileInfo(). 2013-03-19 04:56:51 +00:00
Lukas Toenne
4638e5f99a Merge of the PyNodes branch (aka "custom nodes") into trunk.
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.

=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.

Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].

=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].

The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.

[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
2013-03-18 16:34:57 +00:00
Dalai Felinto
748dd18de4 rst doc update: adding a link to Joystick class from bge.logic.joysticks
(so one can find more about the joystick class without having to search joystick)
code untested by the way. Sorry but I can no longer build sphinx docs here. I will try to fix that later.
2013-02-28 05:18:47 +00:00
Brecht Van Lommel
10f2ad1663 CMake: update cmake.txt documentation to remove some old information and link
to the wiki for detailed cmake build setup instructions.
2013-02-26 00:49:45 +00:00
Brecht Van Lommel
2f69029db6 bf-members.txt encoding changed from Mac Roman to UTF-8 so it displays properly
cross platform, patch by Lawrence D'Oliveiro.
2013-02-21 18:07:59 +00:00
Campbell Barton
a8ebc1b2de edits to document uploading script so the latest release docs can always be found at:
http://www.blender.org/documentation/blender_python_api

Easier for linking wiki docs.
2013-02-20 14:22:36 +00:00
Campbell Barton
648f925017 misc changes
- update man page for new additions since last release.
- note that --start-console argument is windows only.
- correct own assertion in own recent commit.
2013-02-14 05:02:20 +00:00
Mitchell Stokes
372cf93309 BGE: Splitting up the bge.types docs so they are not all on the same page. This should make them much easier to browse. 2013-02-10 06:13:26 +00:00
Bastien Montagne
23aa0c9067 Fix uilists showing data names translated (reported on bf-translations ML by Satoshi Yamasaki aka yamyam, thanks!). 2013-02-08 16:01:21 +00:00
Campbell Barton
ec97183876 add python api docstring for 'bpy.types.Operator.bl_property' 2013-02-05 05:09:19 +00:00
Mitchell Stokes
9191b783bb BGE: Some various changes to make moving the character physics type easier:
* Undoing the previous applyMovement() changes for characters. This was causing bugs for the Motion Actuator.
  * Creating a Character Motion type for the Motion Actuator with specific controls for characters. This includes moving, rotating and jumping.
  * Adding a KX_CharacterWrapper.walkDirection to set the character's direction and speed.

Note, this also resolves the following bugs:
[#33585] "Setting dLoc of motion actuator [0,0,0] via python won't stop object" reported by Manuel Bellersen (urfoex)
[#33503] "Character physics type won´t accept more than one motion anymore" reported by Mr Larodos
2013-01-30 05:55:17 +00:00
Campbell Barton
a1a8e43d5a BGE Py API docs: correct references to bge.keys 2013-01-28 06:39:23 +00:00
Campbell Barton
97d8e34d61 correct addon tutorial section on keymap register/unregister and add label next to image color-depth option.
having buttons labelled [8, 16] on their own is not very meaningful.
2013-01-22 06:41:12 +00:00
Campbell Barton
769ab3eed8 code cleanup:
- cycles ui used 'cscene' for scene.cycles and scene.cycles_curves
- style cleanup
2013-01-15 23:17:45 +00:00
Campbell Barton
9f2e845181 code cleanup: use BMW_begin insode for loops body. 2013-01-14 09:53:56 +00:00
Lukas Toenne
123191881b Added some python API examples for the new get/set callbacks in bpy.props. 2013-01-05 15:50:51 +00:00
Bastien Montagne
9b9da2820b Adding some example for new UIList... 2013-01-05 11:14:35 +00:00
Campbell Barton
e9c7aaaa3c patch [#33609] Syntax highlighting for OSL in Text Editor
from Patrick Boelens (senshi). with modifications to split it into its own function.

also added C style multi-line comment support /* ... */

I've left out the part of this patch that sets the language in the space, since I think this might be better stored in the text block.

For now it simply uses OSL syntax highlighting when the extension is '.osl'.
2012-12-29 18:25:03 +00:00
Campbell Barton
4ed4be1fc2 example use of addon preferences. 2012-12-29 11:07:31 +00:00
Mitchell Stokes
18f134304c BGE: Adding a jumpCount to KX_CharacterWrapper. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump. 2012-12-29 10:22:19 +00:00
Mitchell Stokes
13f49f3101 BGE: Adding a maxJumps to the character controller to adjust how many jumps a character can perform before having to touch the ground. By default this is set to 1, which means a character can only jump once before having to touch the ground again. Setting this to 2 allows for double jumping. 2012-12-26 01:25:53 +00:00
Mitchell Stokes
84966c3d0a BGE: Committing async LibLoad from Swiss. This does the lib loading in a separate thread to keep the BGE from freezing. Here is an example from the docs:
# Print a message when an async LibLoad is done
      import bge

      def finished_cb(status):
          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))

      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb

LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes.
2012-12-22 05:38:32 +00:00
Mitchell Stokes
f2f2b6153a BGE: Adding a Python interface for handling joysticks without needing logic bricks. These new SCA_PythonJoystick objects can be accessed using bge.logic.joysticks, which is a list of joysticks. The length of the list is the number of maximum supported joysticks, and indexes that do not have a joystick available are set to None. This means joysticks can be checked for using something like:
if bge.logic.joysticks[0]:
    activate_player_one()

if bge.logic.joysticks[1]:
    activate_player_two()

etc..

The interface exposed by SCA_PythonJoystick is very similar to the joystick logic brick except for one key difference: axis values are normalized to a -1.0 to 1.0 range instead of -32767 to 32767, which is what the logic brick exposed.
2012-12-21 02:28:59 +00:00
Campbell Barton
a6e9c9fda0 update api changelog 2012-12-11 02:13:42 +00:00
Campbell Barton
4fd9df25c6 Add 2 documents to the python api reference.
- Blender/Python Addon Tutorial: a step by step guide on how to write an addon from scratch

- Blender/Python API Reference Usage: examples of how to use the API reference docs

Thanks to John Nyquist for editing these docs and giving feedback.
2012-12-07 05:27:09 +00:00
Campbell Barton
57d7c1f226 pydna experimental ctypes DNA api was broken with more recent python versions, and some minor doc edits. 2012-12-05 03:38:01 +00:00
Campbell Barton
af51827dda add a message when solidify is used with only-edges, this isn't properly supported.
also minor edits to py-api-ref
-- This line, and those below, will be ignored--

M    doc/python_api/sphinx_doc_gen.py
M    doc/python_api/rst/include__bmesh.rst
M    source/blender/modifiers/intern/MOD_solidify.c
2012-12-05 01:02:41 +00:00
Campbell Barton
c0078a9879 osl style cleanup and update man-page. 2012-12-04 03:18:08 +00:00
Campbell Barton
ca25fd0307 fix [#33389] Curve points restricted to 0..1 range,
also added note on python3.3's faulthandler module.
2012-12-03 07:10:31 +00:00
Campbell Barton
61da29996a fix own mistake with recent commit to skip calculating tessface. If you were already in editmode the tessfaces wouldn't get recalculated.
also minor edits to bmesh rst.
2012-12-03 02:26:13 +00:00
Campbell Barton
f7f4148b40 change uiButGetStrInfo() to use a trailing NULL arg rather then passing the number of args as an arg. 2012-12-02 04:51:15 +00:00
Campbell Barton
b290f9a6cc add bmesh.free() to example & template 2012-12-01 07:16:08 +00:00
Brecht Van Lommel
c3e1813820 Fix related to #33340: add a warning to bge from_id documentation to not store id()
in game object integer properties since it may not fit in 32 bits integers.
2012-11-29 01:25:38 +00:00
Campbell Barton
f828a318f5 include an example in the api docs for using bmesh operators to make 2 links in a chain. 2012-11-28 15:08:45 +00:00
Campbell Barton
4fe35721e6 bmesh operator api reference - add in 'bmesh' arg at the start of each operator, also use :class: references. 2012-11-28 01:14:11 +00:00
Campbell Barton
9775f1d743 generate api reference for 'bmesh.ops', restructured text is extracted from bmesh_opdefines.c.
see:
http://www.blender.org/documentation/blender_python_api_2_64_9/bmesh.ops.html
2012-11-27 06:56:51 +00:00
Campbell Barton
0a5d44588c switch verious references from py3.2 -> 3.3 or just 3. 2012-11-26 13:58:06 +00:00
Mitchell Stokes
f22fb939d3 BGE Docs: Adding some docs for some of the Steering Actuator attributes. I grabbed the docs from the UI descriptions from RNA for the Steering Actuator. However, these aren't the best descriptions, and both the UI descriptions and the docs could use some attention. Also, steeringVec and facingMode didn't have corresponding UI elements, so I've left them undocumented for now. Someone who knows what they do can hopefully document them. 2012-11-23 07:47:53 +00:00
Mitchell Stokes
c6f98cfa95 BGE Docs: Adding docs for bge.logic.NextFrame() and bge.logic.PrintMemInfo() based on their doc strings. There was also an :rtype: in the bge.logic.setExitKey() docs that should have been :type:. 2012-11-22 22:38:31 +00:00
Mitchell Stokes
de57d61f62 BGE Docs: Adding docs for KX_Scene.drawObstacleSimulation() based on its doc string. 2012-11-22 22:25:12 +00:00
Mitchell Stokes
ff94827965 BGE Docs: Documenting missing Sound Actuator attributes based on RNA UI strings. 2012-11-22 22:13:27 +00:00
Mitchell Stokes
f90298bc0a BGE Docs: Adding docs for the KX_GameObject.playAction() play_mode constants. 2012-11-22 21:52:30 +00:00
Mitchell Stokes
2765f1fffc BGE Docs: Reordering the "Various" constants so they are in alphabetical order. 2012-11-22 21:37:12 +00:00
Mitchell Stokes
899290dd47 BGE Docs: Moving the KX_ArmatureSensor.type constant docs from bge.types.rst to bge.logic.rst where the rest of the constants docs are. 2012-11-22 11:09:42 +00:00
Mitchell Stokes
989b5983c8 BGE Docs: Changing ROT_* Armature Channel constants in the docs to be ROT_MODE_* to match the actual constants from bge.logic. 2012-11-22 09:20:36 +00:00
Mitchell Stokes
9b571c2d54 BGE Docs: Fixing indentation. 2012-11-22 09:12:21 +00:00
Campbell Barton
762016c746 indentation edits 2012-11-22 08:30:54 +00:00
Mitchell Stokes
74ffa7bb8a BGE Docs: Adding some basic docs for the KX_STEERING_* constants. Right now just their names and values are in the docs, not what they actually do. 2012-11-22 08:22:46 +00:00
Mitchell Stokes
d9f6edff14 BGE Docs: Moving the BL_ArmatureChannel.rotation_mode constant docs from bge.types.rst to bge.logic.rst where the rest of the constants docs are. 2012-11-22 08:16:30 +00:00
Mitchell Stokes
8dd96bcefb BGE Docs: Moving the BL_ArmatureConstraint constant docs from bge.types.rst to bge.logic.rst with the rest of the constants docs are. 2012-11-22 08:07:13 +00:00
Mitchell Stokes
5da6c02188 BGE Docs: Adding RM_* mode constants from KX_NavMeshObject.draw() 2012-11-22 08:01:02 +00:00
Mitchell Stokes
a660ebc16e Moving the Armature Actuator constant docs from bge.types.rst to bge.logic.rst with the rest of the constants docs are. Not only is this more consistent, but it also makes Campbell's script happier. 2012-11-22 07:52:17 +00:00
Mitchell Stokes
6a5d5ed206 Some KX_CONSTRAINTACT_* constants were incorrectly documented as KX_CONSTRAINT_*. 2012-11-22 07:31:51 +00:00