Search the scene


a If the objects are created, in a second step further manipulations are necessary. The next question is: Which objects are available or exists in a scene?


  1. What is possible with lists? If in doubt, have a look at Python basics: lists
  2. Create a script that executes the code from this station.
  3. Add a new object to the scene and run the script again.

Show all objects

In an new Blender file, in a scene some objects are placed by default. How to get a list of available objects is shown with the following script:

Name: ''
Blender: 2.69
Group: 'Discover'
Tooltip: 'Find objects in a scene'

import bpy

def get_list_of_objects():
    """ Print list of objects in a scene """

    for i in

if __name__ == '__main__':
    # call the new function

The modul contains as structure objects. From this you can get a list of objects of the context, the scene. A for loop is used to print all objects:


<bpy_struct, Object("Camera")>
<bpy_struct, Object("Cube")>
<bpy_struct, Object("Lamp")>
You can imagine, what sort of objects are available in the scene.

This is the output on a command line on windows.