📋 Metadata

💬 Content

Single line code for for loop should look like this:

[setattr(ob, "show_in_front", ac.show_in_front) for ob in bpy.context.selected_objects]

More info.

Final code:

ac = bpy.context.object; ac.show_in_front = not ac.show_in_front; [setattr(ob, "show_in_front", ac.show_in_front) for ob in bpy.context.selected_objects]

🔗 View on Blender Artists