I use a simple toggle wires script to toggle the wireframe of the objects in my viewport on/off. However, I’d like to take this a step further: to any cutters visible in the scene (regular geo with its display type set to WIRE), also them vanish on/off too.
I believe the quickest way would be to toggle the Show in Viewport property of cutter objects (bpy.context.object.hide_viewport = NOT bpy.context.object.hide_viewport), and the way to identify which objects would be by searching the ones with its Display type set to WIRE. Is this a smart and fast way to achieve this? Does anyone know how to smartly & efficiently do this without making the script take a heavy performance toll?
This is the simple script I use:
def wire_toggle(self, context):
if context.space_data.overlay.show_wireframes:
context.space_data.overlay.show_wireframes = False
else:
context.space_data.overlay.show_wireframes = Truedef execute(self, context):
self.wire_toggle(context)
return{'FINISHED'}
Replies