Post #2613: @roaoao

📋 Metadata

🏷️ Tags

macro python-scripting intermediate unsolved

  • Macro Editor
  • Python Scripting

💬 Content

@roaoao
I’m trying to toggle the active object’s show_in_front property, and set the selected objects to match. In multi-line python it works, but combining them to a single line gives me a syntax error. Any idea why?
Thanks a lot!

ac = bpy.context.object; ac.show_in_front = not ac.show_in_front; for ob in bpy.context.selected_objects: ob.show_in_front = ac.show_in_front

🔗 View on Blender Artists