Operator wanted

I want create hot key for 3d view, to hide view display of all modifiers from selected objects

Is it possible?

I think it should be possible, you have to iterate through modifier’s stack and flag ‘False’ the show_viewport property:
bpy.context.active_object.modifers[0].show_viewport = False

there is no elegant solution, since bpy.types.Modifier doesn’t support properties, but i bet a CollectionProp for the parent object would work…

Hi Afir,
Is something like this what you were thinking of? It just toggles viewport visibility as pietro909 suggested. You could put it into an operator if you wanted to.

import bpy

for ob in bpy.context.selected_objects:
    for mo in ob.modifiers:
        mo.show_viewport = not mo.show_viewport

Hope that helps.


Thank you all
Its work!

I’d rather add a toggle button to the modifiers panel, which would override the show_viewport settings. Will check on it soon, but probably has to be done in C code.