Class KX_Scene (2.48)


Methods
getLightList getObjectList
getName -----------
 
Variables
active_camera name
activity_culling suspended
activity_culling_radius ----------
 
Constants
---------- ----------

Inherited Methods:  Class PyObjectPlus
isA ----------



Methods



getLightList

getLightList()

Returns a list of the light objects in the scene.

Return type:  list [KX_Light]

Sample Code

# get the current scene
scene = GameLogic.getCurrentScene()

# get list of light objects in current scene
lightList = scene.getLightList()

# get name of first light in list
name = lightList[0].name

getName

getName()

Returns the name of the current scene.

Return type:  string

Sample Code

# get the current scene
scene = GameLogic.getCurrentScene()

# get the name of the current scene
sceneName = scene.getName()

getObjectList

getObjectList()

Returns a list of the game objects in the scene

Type:  list [KX_GameObject]

Sample Code

# get the current scene
scene = GameLogic.getCurrentScene()

# get a list of the objects in the current scene
objList = scene.getObjectList()

# get name of first object in list
name = objList[0].name


Variables



active_camera

active_camera

Returns active camera object

Sample Code

# get  current scene
scene = GameLogic.getCurrentScene()

# get active camera
cam = scene.active_camera

activity_culling

activity_culling

Returns whether or not the activity culling is being used.  (activity culling disables logic bricks when the camera is more than a certain distance from them.)

Type:  bool
   1 = True = using activity culling
   0 = False = not using activity culling

Sample Code

# get  current scene
scene = GameLogic.getCurrentScene()

# activity culling status
culling = scene.activity_culling

activity_culling_radius

activity_culling_radius

Returns the distance at which activity culling should start.

Type:  float

Note:
Uses Manhattan distance.  

Think city blocks and distance traveled in a city.  

To go from South West corner of a city to North East corner, you can't travel in a straight line.  You would go North one block, East one block, North one block, etc.  

The actual distance you'd have to travel is Manhattan distance.

Sample Code

# get  current scene
scene = GameLogic.getCurrentScene()

# activity culling radius
radius = scene.activity_culling_radius

name

name

Returns the name of the current scene.

Type:  string

Sample Code

# get  current scene
scene = GameLogic.getCurrentScene()

# get scene name
name = scene.name

suspended

suspended

Returns whether or not the scene has been suspended.

Type:  bool
   1 = True = scene was suspended
   0 = False = scene wasn't suspended

Sample Code

# get  current scene
scene = GameLogic.getCurrentScene()

# suspended status
status = scene.suspended



Blender 3D
Game Engine