Toggle wireframe on shaded for all scene objects

Hello,

Coming from 3ds Max I really miss in Blender a way of toggling wireframe on shaded for all scene objects with a single shortcut key. Googling around I found a variety of scripts that come close to the described functionality, I really like the one included in Bforartists, so I installed it in Blender. Still, the issue is I cannot toggle with a single key press.

https://media.giphy.com/media/3o7bu3gJImB7WZvewM/giphy.gif

Does anybody know a script that does actually toggle so I can assign it to a single hotkey?

You can assign a hotkey to the operator by right clicking on Wire + Edges. Just be sure to then save your user settings.

If the issue is being able to toggle for all objects in the scene then it’ll require a bit of tweaking to an existing script or writing your own. I’m not aware of any existing scripts that do this.

You can use this one, though, just copy it into a Text Editor then press ALT+P to run it:


import bpy


class allObjectsEdgesWire(bpy.types.Operator):
    """Toggle Wire Display With All Edges"""
    bl_label = "Toggle All Edges Wire on all objects"
    bl_idname = "object.all_objects_edges_wire"
    bl_description = "Toggle all-edges wireframe on all objects in scene"


    def execute(self, context):


        objs = context.scene.objects


        for obj in objs:
            obj.show_all_edges = not obj.show_all_edges
            obj.show_wire = not obj.show_wire


        return {"FINISHED"}




def register():
    bpy.utils.register_class(allObjectsEdgesWire)


def unregister():
    bpy.utils.unregister_class(allObjectsEdgesWire)


if __name__ == "__main__":
    register()

You can then assign a hotkey via like this:


Thanks Jonathan,

I did run your script and setup a hotkey but it throws me an error when I try to execute it.

What can I possibly be doing wrong?

Attachments


Whoops. There was a silly typo. I just updated the script in the first post with a fix.

wow this is great.

I have one only issue with it, at the moment it swaps the wireframe for all objects no matter if they already have the wire visible or not.

https://media.giphy.com/media/xUA7aZcjvIJnJshljW/giphy.gif

It would be great if in the case there is a mesh (in a selection of multiple) with the wireframe off, it affects only that one alone at first.

But I don’t want to waste more of your time, this is already great as it is.

Thanks a lot!

Moderation: Marking this thread as Solved and closing it. Please continue discussion in this thread.