================ Search the scene ================ .. index:: list of objects, objects af a scene, bpy.data.objects, objectlist .. |a| image:: /images/all/blender-basics/b-find-information/suzanne-100.png Objectives ========== .. tabularcolumns:: | c | l | :border: none +-------+----------------------------------------------------------------------+ | |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? | +-------+----------------------------------------------------------------------+ Instructions ============ :Tasks: 1. What is possible with lists? If in doubt, have a look at :ref:`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: .. literalinclude:: files/object-list.py :language: python :emphasize-lines: 0 The modul *bpy.data* 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: **Result:** :: | You can imagine, what sort of objects are available in the scene. .. image:: /images/all/label-windows.png :width: 64px This is the output on a command line on windows. .. image:: /images/all/blender-basics/b-find-information/output-win.png :width: 500px