# Blender script: add ALL OBJECT to command?

I have got very simple script :

import bpy

bpy.ops.object.select_all(action='SELECT')

bpy.context.object.show_wire = True

bpy.data.objects["Lamp"].show_wire = True

bpy.data.objects["Camera"].show_wire = True

bpy.data.objects["Suzanne.001"].show_wire = True


What i need is that ["Suzanne.001"] will not be specified but rather be something universal for ALL objects in scene, is there something similar like ["all_objects"] or something like that ?

If I understand correctly, you want show_wire to be True for all objects, not just "Suzanne.001"?

If so, all you need to do is iterate over the objects in the scene with a for loop:

for obj in bpy.context.scene.objects:
obj.show_wire = True


Hope this helps!

• Well thank for input, but if I use this let's say in this example : – Tomáš Luža Nov 2 '18 at 12:09
• import bpy bpy.ops.object.select_all(action='SELECT') for obj in bpy.context.scene.objects: obj.show_wire = True – Tomáš Luža Nov 2 '18 at 12:11
• It still doesn't show wire on all objects but one. JESUS this text editor is nightmare :D – Tomáš Luža Nov 2 '18 at 12:11
• I'm struggling to repeat your problem, it may help if you upload the blend file you are using. – A. Bollans Nov 2 '18 at 14:17
• Ok in 2.79 it is indeed working thank you mr. Bollans for solution! Martin Z I am sorry that you see it this way but it really wasn't my intention. I was trying to find it out myself but since i am really newbie in terms of coding I needed help. Yes 2.8 was a problem and I didn't realize that and I will be more careful about that in future, but I don't think I deserve to be accused like that. – Tomáš Luža Nov 2 '18 at 16:02