0
$\begingroup$

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 ?

enter image description here

$\endgroup$
1
$\begingroup$

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!

$\endgroup$
  • $\begingroup$ Well thank for input, but if I use this let's say in this example : $\endgroup$ – Tomáš Luža Nov 2 '18 at 12:09
  • $\begingroup$ import bpy bpy.ops.object.select_all(action='SELECT') for obj in bpy.context.scene.objects: obj.show_wire = True $\endgroup$ – Tomáš Luža Nov 2 '18 at 12:11
  • $\begingroup$ It still doesn't show wire on all objects but one. JESUS this text editor is nightmare :D $\endgroup$ – Tomáš Luža Nov 2 '18 at 12:11
  • $\begingroup$ I'm struggling to repeat your problem, it may help if you upload the blend file you are using. $\endgroup$ – A. Bollans Nov 2 '18 at 14:17
  • 1
    $\begingroup$ 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. $\endgroup$ – Tomáš Luža Nov 2 '18 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.