UPBGEĀ Documentation


Physics shape replacement and duplication

It's now possible for the user to simply replace the physics shape of an object by the one contained in an other object, thanks to:


The physics shape from obj2 will be set to obj1

Also as the bge.logic.LibNew python function allow the user to duplicate a mesh, it's now possible to duplicate the physics mesh shape for this new mesh, thanks to:
obj2.reinstancePhysicsMesh(obj, mesh, dupli)

The dupli argument allow the user to duplicate the physics shape and then update it with the first and second argument.

See also: KX_GameObject.replacePhysicsShape and KX_GameObject.reinstancePhysicsMesh

Material specular alpha and ambient factor

The user can now alterate the material ambient factor, thanks to:
material.ambient = float

And the material specular alpha with:
material.sepcularAlpha = float

See also: KX_BlenderMaterial.ambient and KX_BlenderMaterial.specularAlpha

Steering actuator path

The steering actuator path computed for this frame (or every X frame with pathUpdatePeriod) is now accesible with:

The path is a list of Vector of each point.

See also: KX_SteeringActuator.path

Inactive scenes list

To check if a scene exists and then can be added with bge.logic.addScene, the following list is used:

This function return a list of name of all scenes not added (equivalent to not found in bge.logic.getSceneList()).

See also: getInactiveSceneNames

Rename game objects

The game object can now be renamed, the user have to simply set the name:
object.name = "NewName"

The object will be renamed to "NewName", also objects that was not added in game can be used with theirs new names:

Collision contact points

The collision contact points are now accesible in the form of a list in the python collision callback KX_GameObject.collisionCallbacks. The point list is passed to the fourth argument because of compatibility.
Each item of the list provide the following attributs:

See also: KX_CollisionContactPoint

Vertex UV list

The user can now acces to all eight UV channels thanks to:

uvs is a list of eight Vectors

See also: KX_VertexProxy.uvs

Light hemi type

To know if a light is an hemi lamp, the enum KX_LightObject.HEMI is returned by light.type.

See also: KX_LightObject.HEMI

Python textures
A new python class BL_Texture allow the user to alterate the texture influence to the material. The attributs accesible are:

These textures are alvailable in KX_BlenderMaterialin a list by index and name:

See also: BL_Texture

Material texture lod bias

The lod bias is now moved from texture to per material texture. The option is displayed in texture panel:

Same as before with a negative value the texture will look like there's no mipmapping and a positive value will blured the texture.

See also: BL_Texture.lodBias

Constant material values

The user can now optimize some material values by making them not updated every frame. The categories are: Material, Texture, Lamp, World and Mist. The user can choose what group of value to make constant in material UI:

The constants value can optimize of 25% the rendering time.

Python component

The moguri feature about python component is now updated and refactored for the UPBGE. It allow the user to make itself kind of logic bricks from python. He just have to defines the properties with a dictionary args and two callbacks functions : start(args) and update().

All the components are accesible from the game object with:

Example of third person python component, it only move and rotate the owner object when pressing W, S, A or D.
import bge
from collections import OrderedDict

class ThirdPerson(bge.types.KX_PythonComponent):
"""Basic third person controls

W: move forward
A: turn left
S: move backward
D: turn right



args = OrderedDict([
("Move Speed", 0.1),
("Turn Speed", 0.04),

def start(self, args):
self.move_speed = args['Move Speed']
self.turn_speed = args['Turn Speed']

def update(self):
keyboard = bge.logic.keyboard.events

move = 0
rotate = 0

if keyboard[bge.events.WKEY]:
move += self.move_speed
if keyboard[bge.events.SKEY]:
move -= self.move_speed

if keyboard[bge.events.AKEY]:
rotate += self.turn_speed
if keyboard[bge.events.DKEY]:
rotate -= self.turn_speed

self.object.applyMovement((0, move, 0), True)
self.object.applyRotation((0, 0, rotate), True)

ThirdPerson component from UI:

The property types supported are showed in:

See also: KX_PythonComponent

Refactors and cleanups

- Compilation without python (see 35c8c6a, aa2a2a8, f124b85)
- Replace MT_assert by BLI_assert (see ea6ff7d)
- Thread lock classes (see 54e60b8)
- Increase max UV layer in transformUV (see 387a731)
- Use KX_GameObject::GetScene instead of KX_GetActiveScene (see 3484d2f)
- Cleanup KX_MotionState.[h/cpp] (see 97c7ba1)
- Refactor rasterizer opengl call (see 2f981e5)
- Restore background API for retrocompatibility (see b9069c4)

Bug fixed

- Fix unbinded primitives after unset material (see 30503d5)
- Fix T48099: None accepted in getScreenPosition (see 1883449)
- Fix timer documentation (see 368d752)
- Fix unfreed mesh in KX_GameObject (see 976eb34)