Game Logic (Range.logic)#

Introduction#

Module to access logic functions, imported automatically into the python controllers namespace.

# To get the controller thats running this python script:
cont = Range.logic.getCurrentController() # Range.logic is automatically imported

# To get the game object this controller is on:
obj = cont.owner

KX_GameObject, KX_Camera or KX_LightObject methods are available depending on the type of object. See object types for more reference.

# To get a sensor linked to this controller.
# "sensorname" is the name of the sensor as defined in the Blender interface.
# +---------------------+  +--------+
# | Sensor "sensorname" +--+ Python +
# +---------------------+  +--------+
sens = cont.sensors["sensorname"]

# To get a sequence of all sensors:
sensors = co.sensors

See the available sensors reference for available attributes.

You can also access actuators linked to the controller

# To get an actuator attached to the controller:
#                          +--------+  +-------------------------+
#                          + Python +--+ Actuator "actuatorname" |
#                          +--------+  +-------------------------+
actuator = co.actuators["actuatorname"]

# Activate an actuator
controller.activate(actuator)

See the available actuators reference for available attributes.

Most logic brick’s methods are accessors for the properties available in the logic buttons. Consult the logic bricks documentation for more information on how each logic brick works.

There are also methods to access the current KX_Scene

# Get the current scene
scene = Range.logic.getCurrentScene()

# Get the current camera
cam = scene.active_camera

Matricies as used by the game engine are row major matrix[row][col] = float

KX_Camera has some examples using matrices.

Variables#

Range.logic.globalDict#

A dictionary that is saved between loading blend files so you can use it to store inventory and other variables you want to store between scenes and blend files. It can also be written to a file and loaded later on with the game load/save actuators.

Note

only python built in types such as int/string/bool/float/tuples/lists can be saved, GameObjects, Actuators etc will not work as expected.

Range.logic.keyboard#

The current keyboard wrapped in an KX_PythonKeyboard object.

Range.logic.mouse#

The current mouse wrapped in an KX_PythonMouse object.

Range.logic.joysticks#

A list of attached KX_PythonJoystick. The list size is the maximum number of supported joysticks. If no joystick is available for a given slot, the slot is set to None.

Range.logic.inputSystem#

The current input system wrapped in an KX_InputSystem object.

General functions#

Range.logic.getCurrentController()#

Gets the Python controller associated with this Python script.

Return type:

SCA_PythonController

Range.logic.getCurrentScene()#

Gets the current Scene.

Return type:

KX_Scene

Range.logic.getSceneList()#

Gets a list of the current scenes loaded in the game engine.

Return type:

list of KX_Scene

Note

Scenes in your blend file that have not been converted wont be in this list. This list will only contain scenes such as overlays scenes.

Range.logic.getInactiveSceneNames()#

Gets a list of the scene’s names not loaded in the game engine.

Return type:

list of string

Range.logic.loadGlobalDict(path, extensionName)#

Loads Range.logic.globalDict from a file.

logic.loadGlobalDict("Saves\Save1", "gamesave")
print(logic.globalDict["Name"])
Range.logic.saveGlobalDict(path, extensionName)#

Saves Range.logic.globalDict to a file.

logic.globalDict["Name"] = "Range"
logic.saveGlobalDict("Saves\Save1", "gamesave")
Range.logic.startGame(blend)#

Loads the blend file.

Parameters:

blend (string) – The name of the blend file

Range.logic.endGame()#

Ends the current game.

Range.logic.restartGame()#

Restarts the current game by reloading the .blend file (the last saved version, not what is currently running).

Range.logic.LibLoad(blend, type, data, load_actions=False, verbose=False, load_scripts=True, async=False, scene=None)#

Converts the all of the datablocks of the given type from the given blend.

Parameters:
  • blend (string) – The path to the blend file (or the name to use for the library if data is supplied)

  • type (string) – The datablock type (currently only “Action”, “Mesh” and “Scene” are supported)

  • data (bytes) – Binary data from a blend file (optional)

  • load_actions (bool) – Search for and load all actions in a given Scene and not just the “active” actions (Scene type only)

  • verbose (bool) – Whether or not to print debugging information (e.g., “SceneName: Scene”)

  • load_scripts (bool) – Whether or not to load text datablocks as well (can be disabled for some extra security)

  • async (bool) – Whether or not to do the loading asynchronously (in another thread). Only the “Scene” type is currently supported for this feature.

  • scene (KX_Scene or string) – Scene to merge loaded data to, if None use the current scene.

Return type:

KX_LibLoadStatus

Note

Asynchronously loaded libraries will not be available immediately after LibLoad() returns. Use the returned KX_LibLoadStatus to figure out when the libraries are ready.

Range.logic.LibNew(name, type, data)#

Uses existing datablock data and loads in as a new library.

Parameters:
  • name (string) – A unique library name used for removal later

  • type (string) – The datablock type (currently only “Mesh” is supported)

  • data (list of strings) – A list of names of the datablocks to load

Range.logic.LibFree(name)#

Frees a library, removing all objects and meshes from the currently active scenes.

Parameters:

name (string) – The name of the library to free (the name used in LibNew)

Range.logic.LibList()#

Returns a list of currently loaded libraries.

Return type:

list [str]

Range.logic.addScene(name, overlay=1)#

Loads a scene into the game engine.

Note

This function is not effective immediately, the scene is queued and added on the next logic cycle where it will be available from getSceneList

Parameters:
  • name (string) – The name of the scene

  • overlay (integer) – Overlay or underlay (optional)

Range.logic.sendMessage(subject, body='', to='', message_from='')#

Sends a message to sensors in any active scene.

Parameters:
  • subject (string) – The subject of the message

  • body (string) – The body of the message (optional)

  • to (string) – The name of the object to send the message to (optional)

  • message_from (string) – The name of the object that the message is coming from (optional)

Range.logic.setGravity(gravity)#

Sets the world gravity.

Parameters:

gravity (Vector((fx, fy, fz))) – gravity vector

Range.logic.getSpectrum() (Deprecated)#

Returns a 512 point list from the sound card. This only works if the fmod sound driver is being used.

Return type:

list [float], len(getSpectrum()) == 512

Range.logic.getMaxLogicFrame()#

Gets the maximum number of logic frames per render frame.

Returns:

The maximum number of logic frames per render frame

Return type:

integer

Range.logic.setMaxLogicFrame(maxlogic)#

Sets the maximum number of logic frames that are executed per render frame. This does not affect the physic system that still runs at full frame rate.

Parameters:

maxlogic (integer) – The new maximum number of logic frames per render frame. Valid values: 1..5

Range.logic.getMaxPhysicsFrame()#

Gets the maximum number of physics frames per render frame.

Returns:

The maximum number of physics frames per render frame

Return type:

integer

Range.logic.setMaxPhysicsFrame(maxphysics)#

Sets the maximum number of physics timestep that are executed per render frame. Higher value allows physics to keep up with realtime even if graphics slows down the game. Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate) maxphysics/ticrate is the maximum delay of the renderer that physics can compensate.

Parameters:

maxphysics (integer) – The new maximum number of physics timestep per render frame. Valid values: 1..5.

Range.logic.getLogicTicRate()#

Gets the logic update frequency.

Returns:

The logic frequency in Hz

Return type:

float

Range.logic.setLogicTicRate(ticrate)#

Sets the logic update frequency.

The logic update frequency is the number of times logic bricks are executed every second. The default is 60 Hz.

Parameters:

ticrate (float) – The new logic update frequency (in Hz).

Range.logic.getPhysicsTicRate()#

Gets the physics update frequency

Returns:

The physics update frequency in Hz

Return type:

float

Range.logic.setPhysicsTicRate(ticrate)#

Sets the physics update frequency

The physics update frequency is the number of times the physics system is executed every second. The default is 60 Hz.

Parameters:

ticrate (float) – The new update frequency (in Hz).

Range.logic.getExitKey()#

Gets the key used to exit the game engine

Returns:

The key (defaults to Range.events.ESCKEY)

Return type:

int

Range.logic.setExitKey(key)#

Sets the key used to exit the game engine

Parameters:

key (int) – A key constant from Range.events

Range.logic.NextFrame()#

Render next frame (if Python has control)

Range.logic.setRender(render)#

Sets the global flag that controls the render of the scene. If True, the render is done after the logic frame. If False, the render is skipped and another logic frame starts immediately.

Note

GPU VSync no longer limits the number of frame per second when render is off, but the Use Frame Rate option still regulates the fps. To run as many frames as possible, untick this option (Render Properties, System panel).

Parameters:

render (bool) – the render flag

Range.logic.getRender()#

Get the current value of the global render flag

Returns:

The flag value

Return type:

bool

Utility functions#

Range.logic.expandPath(path)#

Converts a blender internal path into a proper file system path.

Use / as directory separator in path You can use ‘//’ at the start of the string to define a relative path; Blender replaces that string by the directory of the current .blend or runtime file to make a full path name. The function also converts the directory separator to the local file system format.

Parameters:

path (string) – The path string to be converted/expanded.

Returns:

The converted string

Return type:

string

Range.logic.getAverageFrameRate()#

Gets the estimated/average framerate for all the active scenes, not only the current scene.

Returns:

The estimated average framerate in frames per second

Return type:

float

Range.logic.getBlendFileList(path='//')#

Returns a list of blend files in the same directory as the open blend file, or from using the option argument.

Parameters:

path (string) – Optional directory argument, will be expanded (like expandPath) into the full path.

Returns:

A list of filenames, with no directory prefix

Return type:

list

Range.logic.getRasecFileList(path='//')#

Returns a list of rasec files in the same directory as the open rasec file, or from using the option argument.

Parameters:

path (string) – Optional directory argument, will be expanded (like expandPath) into the full path.

Returns:

A list of filenames, with no directory prefix

Return type:

list

Range.logic.getRandomFloat()#

Returns a random floating point value in the range [0 - 1]

Range.logic.PrintGLInfo()#

Prints GL Extension Info into the console

Range.logic.GraphicsCardVendor()#

Get the active graphics card vendor

Return type:

string

Range.logic.GraphicsCardRenderer()#

Get the active graphics card name

Return type:

string

Range.logic.PrintMemInfo()#

Prints engine statistics into the console

Range.logic.getProfileInfo()#

Returns a Python dictionary that contains the same information as the on screen profiler. The keys are the profiler categories and the values are tuples with the first element being time taken (in ms) and the second element being the percentage of total time.

Constants#

Range.logic.KX_TRUE#

True value used by some modules.

Value:

1

Range.logic.KX_FALSE#

False value used by some modules.

Value:

2

Sensors#

Sensor Status#

See SCA_ISensor.status

Range.logic.KX_SENSOR_INACTIVE#
Value:

0

Range.logic.KX_SENSOR_JUST_ACTIVATED#
Value:

1

Range.logic.KX_SENSOR_ACTIVE#
Value:

2

Range.logic.KX_SENSOR_JUST_DEACTIVATED#
Value:

3

Armature Sensor#

See KX_ArmatureSensor.type

Range.logic.KX_ARMSENSOR_STATE_CHANGED#

Detect that the constraint is changing state (active/inactive).

Value:

0

Range.logic.KX_ARMSENSOR_LIN_ERROR_BELOW#

Detect that the constraint linear error is above a threshold.

Value:

1

Range.logic.KX_ARMSENSOR_LIN_ERROR_ABOVE#

Detect that the constraint linear error is below a threshold.

Value:

2

Range.logic.KX_ARMSENSOR_ROT_ERROR_BELOW#

Detect that the constraint rotation error is above a threshold.

Value:

3

Range.logic.KX_ARMSENSOR_ROT_ERROR_ABOVE#

Detect that the constraint rotation error is below a threshold.

Value:

4

Movement Sensor#

See KX_MovementSensor.axis

Range.logic.KX_MOVEMENT_ALL_AXIS#
Value:

6

Range.logic.KX_MOVEMENT_AXIS_NEG_X#
Value:

3

Range.logic.KX_MOVEMENT_AXIS_NEG_Y#
Value:

4

Range.logic.KX_MOVEMENT_AXIS_NEG_Z#
Value:

5

Range.logic.KX_MOVEMENT_AXIS_POS_X#
Value:

1

Range.logic.KX_MOVEMENT_AXIS_POS_Y#
Value:

0

Range.logic.KX_MOVEMENT_AXIS_POS_Z#
Value:

2

Property Sensor#

See SCA_PropertySensor.mode

Range.logic.KX_PROPSENSOR_EQUAL#

Activate when the property is equal to the sensor value.

Value:

1

Range.logic.KX_PROPSENSOR_NOTEQUAL#

Activate when the property is not equal to the sensor value.

Value:

2

Range.logic.KX_PROPSENSOR_INTERVAL#

Activate when the property is between the specified limits.

Value:

3

Range.logic.KX_PROPSENSOR_CHANGED#

Activate when the property changes.

Value:

4

Range.logic.KX_PROPSENSOR_EXPRESSION#

Activate when the expression matches.

Value:

5

Range.logic.KX_PROPSENSOR_LESSTHAN#

Activate when the property is less than the sensor value.

Value:

6

Range.logic.KX_PROPSENSOR_GREATERTHAN#

Activate when the property is greater than the sensor value.

Value:

7

Radar Sensor#

See KX_RadarSensor.axis

Range.logic.KX_RADAR_AXIS_POS_X#
Value:

0

Range.logic.KX_RADAR_AXIS_POS_Y#
Value:

1

Range.logic.KX_RADAR_AXIS_POS_Z#
Value:

2

Range.logic.KX_RADAR_AXIS_NEG_X#
Value:

3

Range.logic.KX_RADAR_AXIS_NEG_Y#
Value:

4

Range.logic.KX_RADAR_AXIS_NEG_Z#
Value:

5

Ray Sensor#

See KX_RaySensor.axis

Range.logic.KX_RAY_AXIS_POS_X#
Value:

1

Range.logic.KX_RAY_AXIS_POS_Y#
Value:

0

Range.logic.KX_RAY_AXIS_POS_Z#
Value:

2

Range.logic.KX_RAY_AXIS_NEG_X#
Value:

3

Range.logic.KX_RAY_AXIS_NEG_Y#
Value:

4

Range.logic.KX_RAY_AXIS_NEG_Z#
Value:

5

Actuators#

Action Actuator#

See BL_ActionActuator

Range.logic.KX_ACTIONACT_PLAY#
Value:

0

Range.logic.KX_ACTIONACT_PINGPONG#
Value:

1

Range.logic.KX_ACTIONACT_FLIPPER#
Value:

2

Range.logic.KX_ACTIONACT_LOOPSTOP#
Value:

3

Range.logic.KX_ACTIONACT_LOOPEND#
Value:

4

Range.logic.KX_ACTIONACT_PROPERTY#
Value:

6

Armature Actuator#

See BL_ArmatureActuator.type

Range.logic.KX_ACT_ARMATURE_RUN#

Just make sure the armature will be updated on the next graphic frame. This is the only persistent mode of the actuator: it executes automatically once per frame until stopped by a controller

Value:

0

Range.logic.KX_ACT_ARMATURE_ENABLE#

Enable the constraint.

Value:

1

Range.logic.KX_ACT_ARMATURE_DISABLE#

Disable the constraint (runtime constraint values are not updated).

Value:

2

Range.logic.KX_ACT_ARMATURE_SETTARGET#

Change target and subtarget of constraint.

Value:

3

Range.logic.KX_ACT_ARMATURE_SETWEIGHT#

Change weight of constraint (IK only).

Value:

4

Range.logic.KX_ACT_ARMATURE_SETINFLUENCE#

Change influence of constraint.

Value:

5

Constraint Actuator#

See KX_ConstraintActuator.option

  • Applicable to Distance constraint:

Range.logic.KX_CONSTRAINTACT_NORMAL#

Activate alignment to surface.

Value:

64

Range.logic.KX_CONSTRAINTACT_DISTANCE#

Activate distance control.

Value:

512

Range.logic.KX_CONSTRAINTACT_LOCAL#

Direction of the ray is along the local axis.

Value:

1024

  • Applicable to Force field constraint:

Range.logic.KX_CONSTRAINTACT_DOROTFH#

Force field act on rotation as well.

Value:

2048

  • Applicable to both:

Range.logic.KX_CONSTRAINTACT_MATERIAL#

Detect material rather than property.

Value:

128

Range.logic.KX_CONSTRAINTACT_PERMANENT#

No deactivation if ray does not hit target.

Value:

256

See KX_ConstraintActuator.limit

Range.logic.KX_CONSTRAINTACT_LOCX#

Limit X coord.

Value:

1

Range.logic.KX_CONSTRAINTACT_LOCY#

Limit Y coord.

Value:

2

Range.logic.KX_CONSTRAINTACT_LOCZ#

Limit Z coord.

Value:

3

Range.logic.KX_CONSTRAINTACT_ROTX#

Limit X rotation.

Value:

4

Range.logic.KX_CONSTRAINTACT_ROTY#

Limit Y rotation.

Value:

5

Range.logic.KX_CONSTRAINTACT_ROTZ#

Limit Z rotation.

Value:

6

Range.logic.KX_CONSTRAINTACT_DIRNX#

Set distance along negative X axis.

Value:

10

Range.logic.KX_CONSTRAINTACT_DIRNY#

Set distance along negative Y axis.

Value:

11

Range.logic.KX_CONSTRAINTACT_DIRNZ#

Set distance along negative Z axis.

Value:

12

Range.logic.KX_CONSTRAINTACT_DIRPX#

Set distance along positive X axis.

Value:

7

Range.logic.KX_CONSTRAINTACT_DIRPY#

Set distance along positive Y axis.

Value:

8

Range.logic.KX_CONSTRAINTACT_DIRPZ#

Set distance along positive Z axis.

Value:

9

Range.logic.KX_CONSTRAINTACT_ORIX#

Set orientation of X axis.

Value:

13

Range.logic.KX_CONSTRAINTACT_ORIY#

Set orientation of Y axis.

Value:

14

Range.logic.KX_CONSTRAINTACT_ORIZ#

Set orientation of Z axis.

Value:

15

Range.logic.KX_CONSTRAINTACT_FHNX#

Set force field along negative X axis.

Value:

19

Range.logic.KX_CONSTRAINTACT_FHNY#

Set force field along negative Y axis.

Value:

20

Range.logic.KX_CONSTRAINTACT_FHNZ#

Set force field along negative Z axis.

Value:

21

Range.logic.KX_CONSTRAINTACT_FHPX#

Set force field along positive X axis.

Value:

16

Range.logic.KX_CONSTRAINTACT_FHPY#

Set force field along positive Y axis.

Value:

17

Range.logic.KX_CONSTRAINTACT_FHPZ#

Set force field along positive Z axis.

Value:

18

Dynamic Actuator#

See KX_SCA_DynamicActuator

Range.logic.KX_DYN_RESTORE_DYNAMICS#
Value:

0

Range.logic.KX_DYN_DISABLE_DYNAMICS#
Value:

1

Range.logic.KX_DYN_ENABLE_RIGID_BODY#
Value:

2

Range.logic.KX_DYN_DISABLE_RIGID_BODY#
Value:

3

Range.logic.KX_DYN_SET_MASS#
Value:

4

Game Actuator#

See KX_GameActuator

Range.logic.KX_GAME_LOAD#
Value:

1

Range.logic.KX_GAME_START#
Value:

2

Range.logic.KX_GAME_RESTART#
Value:

3

Range.logic.KX_GAME_QUIT#
Value:

4

Range.logic.KX_GAME_SAVECFG#
Value:

5

Range.logic.KX_GAME_LOADCFG#
Value:

6

Mouse Actuator#

See KX_MouseActuator

Range.logic.KX_ACT_MOUSE_OBJECT_AXIS_X#
Value:

0

Range.logic.KX_ACT_MOUSE_OBJECT_AXIS_Y#
Value:

1

Range.logic.KX_ACT_MOUSE_OBJECT_AXIS_Z#
Value:

2

Parent Actuator#

See KX_ParentActuator

Range.logic.KX_PARENT_REMOVE#
Value:

2

Range.logic.KX_PARENT_SET#
Value:

1

Random Distributions#

See SCA_RandomActuator

Range.logic.KX_RANDOMACT_BOOL_CONST#
Value:

1

Range.logic.KX_RANDOMACT_BOOL_UNIFORM#
Value:

2

Range.logic.KX_RANDOMACT_BOOL_BERNOUILLI#
Value:

3

Range.logic.KX_RANDOMACT_INT_CONST#
Value:

4

Range.logic.KX_RANDOMACT_INT_UNIFORM#
Value:

5

Range.logic.KX_RANDOMACT_INT_POISSON#
Value:

6

Range.logic.KX_RANDOMACT_FLOAT_CONST#
Value:

7

Range.logic.KX_RANDOMACT_FLOAT_UNIFORM#
Value:

8

Range.logic.KX_RANDOMACT_FLOAT_NORMAL#
Value:

9

Range.logic.KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL#
Value:

10

Scene Actuator#

See KX_SceneActuator

Range.logic.KX_SCENE_RESTART#
Value:

1

Range.logic.KX_SCENE_SET_SCENE#
Value:

2

Range.logic.KX_SCENE_SET_CAMERA#
Value:

3

Range.logic.KX_SCENE_ADD_FRONT_SCENE#
Value:

4

Range.logic.KX_SCENE_ADD_BACK_SCENE#
Value:

5

Range.logic.KX_SCENE_REMOVE_SCENE#
Value:

6

Range.logic.KX_SCENE_SUSPEND#
Value:

7

Range.logic.KX_SCENE_RESUME#
Value:

8

Sound Actuator#

See KX_SoundActuator

Range.logic.KX_SOUNDACT_PLAYSTOP#
Value:

1

Range.logic.KX_SOUNDACT_PLAYEND#
Value:

2

Range.logic.KX_SOUNDACT_LOOPSTOP#
Value:

3

Range.logic.KX_SOUNDACT_LOOPEND#
Value:

4

Range.logic.KX_SOUNDACT_LOOPBIDIRECTIONAL#
Value:

5

Range.logic.KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP#
Value:

6

Steering Actuator#

See KX_SteeringActuator.behavior

Range.logic.KX_STEERING_SEEK#
Value:

1

Range.logic.KX_STEERING_FLEE#
Value:

2

Range.logic.KX_STEERING_PATHFOLLOWING#
Value:

3

TrackTo Actuator#

See KX_TrackToActuator

Range.logic.KX_TRACK_UPAXIS_POS_X#
Value:

0

Range.logic.KX_TRACK_UPAXIS_POS_Y#
Value:

1

Range.logic.KX_TRACK_UPAXIS_POS_Z#
Value:

2

Range.logic.KX_TRACK_TRAXIS_POS_X#
Value:

0

Range.logic.KX_TRACK_TRAXIS_POS_Y#
Value:

1

Range.logic.KX_TRACK_TRAXIS_POS_Z#
Value:

2

Range.logic.KX_TRACK_TRAXIS_NEG_X#
Value:

3

Range.logic.KX_TRACK_TRAXIS_NEG_Y#
Value:

4

Range.logic.KX_TRACK_TRAXIS_NEG_Z#
Value:

5

Various#

2D Filter#

See KX_2DFilterActuator.mode

Range.logic.RAS_2DFILTER_BLUR#
Value:

2

Range.logic.RAS_2DFILTER_CUSTOMFILTER#

Customer filter, the code code is set via shaderText property.

Value:

12

Range.logic.RAS_2DFILTER_DILATION#
Value:

4

Range.logic.RAS_2DFILTER_DISABLED#

Disable the filter that is currently active.

Value:

-1

Range.logic.RAS_2DFILTER_ENABLED#

Enable the filter that was previously disabled.

Value:

-2

Range.logic.RAS_2DFILTER_EROSION#
Value:

5

Range.logic.RAS_2DFILTER_GRAYSCALE#
Value:

9

Range.logic.RAS_2DFILTER_INVERT#
Value:

11

Range.logic.RAS_2DFILTER_LAPLACIAN#
Value:

6

Range.logic.RAS_2DFILTER_MOTIONBLUR#

Create and enable preset filters.

Value:

1

Range.logic.RAS_2DFILTER_NOFILTER#

Disable and destroy the filter that is currently active.

Value:

0

Range.logic.RAS_2DFILTER_PREWITT#
Value:

8

Range.logic.RAS_2DFILTER_SEPIA#
Value:

10

Range.logic.RAS_2DFILTER_SHARPEN#
Value:

3

Range.logic.RAS_2DFILTER_SOBEL#
Value:

7

Armature Channel#

See BL_ArmatureChannel.rotation_mode

Range.logic.ROT_MODE_QUAT#

Use quaternion in rotation attribute to update bone rotation.

Value:

0

Range.logic.ROT_MODE_XYZ#

Use euler_rotation and apply angles on bone’s Z, Y, X axis successively.

Value:

1

Range.logic.ROT_MODE_XZY#

Use euler_rotation and apply angles on bone’s Y, Z, X axis successively.

Value:

2

Range.logic.ROT_MODE_YXZ#

Use euler_rotation and apply angles on bone’s Z, X, Y axis successively.

Value:

3

Range.logic.ROT_MODE_YZX#

Use euler_rotation and apply angles on bone’s X, Z, Y axis successively.

Value:

4

Range.logic.ROT_MODE_ZXY#

Use euler_rotation and apply angles on bone’s Y, X, Z axis successively.

Value:

5

Range.logic.ROT_MODE_ZYX#

Use euler_rotation and apply angles on bone’s X, Y, Z axis successively.

Value:

6

Armature Constraint#

See BL_ArmatureConstraint.type

Range.logic.CONSTRAINT_TYPE_TRACKTO#
Value:

2

Range.logic.CONSTRAINT_TYPE_KINEMATIC#
Value:

3

Range.logic.CONSTRAINT_TYPE_ROTLIKE#
Value:

8

Range.logic.CONSTRAINT_TYPE_LOCLIKE#
Value:

9

Range.logic.CONSTRAINT_TYPE_MINMAX#
Value:

16

Range.logic.CONSTRAINT_TYPE_SIZELIKE#
Value:

10

Range.logic.CONSTRAINT_TYPE_LOCKTRACK#
Value:

13

Range.logic.CONSTRAINT_TYPE_STRETCHTO#
Value:

15

Range.logic.CONSTRAINT_TYPE_CLAMPTO#
Value:

18

Range.logic.CONSTRAINT_TYPE_TRANSFORM#
Value:

19

Range.logic.CONSTRAINT_TYPE_DISTLIMIT#
Value:

14

See BL_ArmatureConstraint.ik_type

Range.logic.CONSTRAINT_IK_COPYPOSE#

Constraint is trying to match the position and eventually the rotation of the target.

Value:

0

Range.logic.CONSTRAINT_IK_DISTANCE#

Constraint is maintaining a certain distance to target subject to ik_mode.

Value:

1

See BL_ArmatureConstraint.ik_flag

Range.logic.CONSTRAINT_IK_FLAG_TIP#

Set when the constraint operates on the head of the bone and not the tail.

Value:

1

Range.logic.CONSTRAINT_IK_FLAG_ROT#

Set when the constraint tries to match the orientation of the target.

Value:

2

Range.logic.CONSTRAINT_IK_FLAG_STRETCH#

Set when the armature is allowed to stretch (only the bones with stretch factor > 0.0).

Value:

16

Range.logic.CONSTRAINT_IK_FLAG_POS#

Set when the constraint tries to match the position of the target.

Value:

32

See BL_ArmatureConstraint.ik_mode

Range.logic.CONSTRAINT_IK_MODE_INSIDE#

The constraint tries to keep the bone within ik_dist of target.

Value:

0

Range.logic.CONSTRAINT_IK_MODE_OUTSIDE#

The constraint tries to keep the bone outside ik_dist of the target.

Value:

1

Range.logic.CONSTRAINT_IK_MODE_ONSURFACE#

The constraint tries to keep the bone exactly at ik_dist of the target.

Value:

2

Blender Material#

Range.logic.BL_DST_ALPHA#
Value:

8

Range.logic.BL_DST_COLOR#
Value:

4

Range.logic.BL_ONE#
Value:

1

Range.logic.BL_ONE_MINUS_DST_ALPHA#
Value:

9

Range.logic.BL_ONE_MINUS_DST_COLOR#
Value:

5

Range.logic.BL_ONE_MINUS_SRC_ALPHA#
Value:

7

Range.logic.BL_ONE_MINUS_SRC_COLOR#
Value:

3

Range.logic.BL_SRC_ALPHA#
Value:

6

Range.logic.BL_SRC_ALPHA_SATURATE#
Value:

10

Range.logic.BL_SRC_COLOR#
Value:

2

Range.logic.BL_ZERO#
Value:

0

Input Status#

See SCA_PythonKeyboard, SCA_PythonMouse, SCA_MouseSensor, SCA_KeyboardSensor

Range.logic.KX_INPUT_NONE#
Value:

0

Range.logic.KX_INPUT_JUST_ACTIVATED#
Value:

1

Range.logic.KX_INPUT_ACTIVE#
Value:

2

Range.logic.KX_INPUT_JUST_RELEASED#
Value:

3

KX_GameObject#

See KX_GameObject.playAction

Range.logic.KX_ACTION_MODE_PLAY#

Play the action once.

Value:

0

Range.logic.KX_ACTION_MODE_LOOP#

Loop the action (repeat it).

Value:

1

Range.logic.KX_ACTION_MODE_PING_PONG#

Play the action one direct then back the other way when it has completed.

Value:

2

Range.logic.KX_ACTION_BLEND_BLEND#

Blend layers using linear interpolation.

Value:

0

Range.logic.KX_ACTION_BLEND_ADD#

Adds the layers together.

Value:

1

Mouse Buttons#

See SCA_MouseSensor

Range.logic.KX_MOUSE_BUT_LEFT#
Value:

116

Range.logic.KX_MOUSE_BUT_MIDDLE#
Value:

117

Range.logic.KX_MOUSE_BUT_RIGHT#
Value:

118

Shader#

Range.logic.VIEWMATRIX#
Value:

0

Range.logic.VIEWMATRIX_INVERSE#
Value:

10

Range.logic.VIEWMATRIX_INVERSETRANSPOSE#
Value:

11

Range.logic.VIEWMATRIX_TRANSPOSE#
Value:

9

Range.logic.MODELMATRIX#
Value:

4

Range.logic.MODELMATRIX_INVERSE#
Value:

6

Range.logic.MODELMATRIX_INVERSETRANSPOSE#
Value:

7

Range.logic.MODELMATRIX_TRANSPOSE#
Value:

5

Range.logic.MODELVIEWMATRIX#
Value:

0

Range.logic.MODELVIEWMATRIX_INVERSE#
Value:

2

Range.logic.MODELVIEWMATRIX_INVERSETRANSPOSE#
Value:

3

Range.logic.MODELVIEWMATRIX_TRANSPOSE#
Value:

1

Range.logic.CAM_POS#

Current camera position

Value:

12

Range.logic.CONSTANT_TIMER#
Value:

13

Range.logic.EYE#

User a timer for the uniform value.

Value:

14

Range.logic.SHD_TANGENT#
Value:

1

States#

See KX_StateActuator

Range.logic.KX_STATE1#
Value:

1

Range.logic.KX_STATE2#
Value:

2

Range.logic.KX_STATE3#
Value:

4

Range.logic.KX_STATE4#
Value:

8

Range.logic.KX_STATE5#
Value:

16

Range.logic.KX_STATE6#
Value:

32

Range.logic.KX_STATE7#
Value:

64

Range.logic.KX_STATE8#
Value:

128

Range.logic.KX_STATE9#
Value:

256

Range.logic.KX_STATE10#
Value:

512

Range.logic.KX_STATE11#
Value:

1024

Range.logic.KX_STATE12#
Value:

2048

Range.logic.KX_STATE13#
Value:

4096

Range.logic.KX_STATE14#
Value:

8192

Range.logic.KX_STATE15#
Value:

16384

Range.logic.KX_STATE16#
Value:

32768

Range.logic.KX_STATE17#
Value:

65536

Range.logic.KX_STATE18#
Value:

131072

Range.logic.KX_STATE19#
Value:

262144

Range.logic.KX_STATE20#
Value:

524288

Range.logic.KX_STATE21#
Value:

1048576

Range.logic.KX_STATE22#
Value:

2097152

Range.logic.KX_STATE23#
Value:

4194304

Range.logic.KX_STATE24#
Value:

8388608

Range.logic.KX_STATE25#
Value:

16777216

Range.logic.KX_STATE26#
Value:

33554432

Range.logic.KX_STATE27#
Value:

67108864

Range.logic.KX_STATE28#
Value:

134217728

Range.logic.KX_STATE29#
Value:

268435456

Range.logic.KX_STATE30#
Value:

536870912

See KX_StateActuator.operation

Range.logic.KX_STATE_OP_CLR#

Substract bits to state mask.

Value:

2

Range.logic.KX_STATE_OP_CPY#

Copy state mask.

Value:

0

Range.logic.KX_STATE_OP_NEG#

Invert bits to state mask.

Value:

3

Range.logic.KX_STATE_OP_SET#

Add bits to state mask.

Value:

1