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
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
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
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
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
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
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
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.
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
- 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.
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
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
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() )
```
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
"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
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
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
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.
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
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
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