4
$\begingroup$

When you're modeling with a low res polygon and smoothing it with a Subdivision surface modifier, is there a way to toggle on/off the modifier's visibility using hotkeys instead of having to click on the "eye" icon ?

$\endgroup$
3
  • $\begingroup$ The workaround I could think of is to animate visibility of modifier (I while hovering Eye icon) in 2 frames, in 1-st visibility checked, in 2-nd frame - unchecked. Then you could use Left or Right Arrow to toggle its visibility. This won't work well if there's another complex animation in file though. $\endgroup$
    – Mr Zak
    Commented Feb 13, 2016 at 15:16
  • $\begingroup$ You could write a simple python script, have the text editor open in a small window and hover over and press <kbd>Alt</kbd>+<kbd>P</kbd>. that will do. I can write the script when I'm on my PC, but I won't take the fun away if you want to do it yourself. it should save the state of the modifier and toggle between '0' and 'x' every time you run the script. I did something like that for the console, which is very useful for scripting. If you don't want to have the text editor open, there is an addon for global script shortcuts. Forgot the name, but I'll comment it below (: $\endgroup$
    – e-proxy
    Commented Feb 13, 2016 at 15:43
  • $\begingroup$ Ctrl + Keyboard 0 is the equivalent, setting subdiv levels to 0. $\endgroup$
    – Robin Betts
    Commented May 29, 2018 at 13:10

3 Answers 3

5
$\begingroup$

Toggle Simplify on/off

One easy approach is creating a shortcut for Simplify, which also affects subdivision display settings in the 3D View. The following Add-on creates the shortcut to toggle Simplify on/off automatically. Once the Add-on is enabled, you can press ShiftQ:

enter image description here

  1. Download the latest version

  2. Extract the archive

  3. Install blender-toggle-simplify.py via File > User Preferences > Add-ons

  4. Change the key configuration according to your personal preference

    enter image description here


Toggle Modifier Visibility on/off

Another approach would be to toggle the visibility of the objects subsurf modifier(s) on and off. Depending on the current state, the following Add-on allows to press ShiftQ to enable/disable the Display property of all modifiers based on a given type.

enter image description here

  1. Download the latest version

  2. Extract the archive

  3. Install blender-toggle-modifier-visibility.py via File > User Preferences > Add-ons

  4. Set the type of modifier you would like to turn on or off (Subdivision Subsurface is just the default setting)

    enter image description here

  5. Change the shortcut configuration according to your personal preference

    enter image description here

$\endgroup$
7
  • $\begingroup$ using the wm.context_toggle method from the other answer would achieve the same by typing in scene.render.use_simplify in the Context Attribute Field $\endgroup$
    – aliasguru
    Commented Sep 25, 2016 at 19:23
  • $\begingroup$ Thanks, I know but I personally don't like creating shortcuts this way for many reasons, so I wouldn't recommend it. However, feel free to edit my answer. I'd really appreciate it @aliasguru $\endgroup$
    – p2or
    Commented Sep 26, 2016 at 11:12
  • $\begingroup$ @p20r This is just what I was looking for! But I have a question. Is there a way to incorporate this into a menu button. I've included an attempt at this. My attempt can be found as a comment on your git page where this script can be downloaded gist.github.com/p2or/e0568d20cca23c8f5673 Please see that comment for more information if you're interested. Thanks for sharing! Eventually I want to incorporate this into a pie menu. $\endgroup$ Commented Jun 19, 2018 at 4:31
  • $\begingroup$ @P20r I'd like to be able to use CTRL+SPACE in edit and object mode. How about a pie menu? :) Thank you! $\endgroup$ Commented Jun 20, 2018 at 17:49
  • $\begingroup$ Pie menu with both operators (Toggle Simplify and Toggle Subsurf Visibility) based on Templates > Python > Ui Pie Menu, see this new gist. Since Ctrl+Space is already occupied by the official pie-menu I think Ctrl+Shift+Space is more appropriate right? To add your operators to a panel or even a custom menu, see How to create a custom UI? @InternetWarriors $\endgroup$
    – p2or
    Commented Jun 21, 2018 at 12:54
4
$\begingroup$

When the object is selected, you can change the levels ("View") Property of the topmost Subsurf modifier, with Ctrl[number]

  • Ctrl0 0 view levels, meaning no subdivision in the viewport
  • Ctrl1 1 view level
  • Ctrl2 2 view levels
  • Ctrl3 ...
$\endgroup$
1
$\begingroup$

Consider the following example. If an object has no subsurf modifier present, you will get an error dialog, which is annoying, but as long as you are fine with clicking it away, this gets the job done.

enter image description here

____EDIT:____

If there are multiple subsurf modifiers, and all of them should be shown or hidden, a simple add-on could be written that has code like the following:

from bpy import context

for selected in contex.selected_objects:
    for modifier in selected.modifiers:
        if modifier.type == "SUBSURF":
            context.object.modifiers[modifier.name].show_viewport = not context.object.modifiers[modifier.name].show_viewport
$\endgroup$
3
  • $\begingroup$ What if the modifiers name is Subsurf.001 or the object has multiple subsurf modifiers? $\endgroup$
    – p2or
    Commented Sep 26, 2016 at 11:33
  • $\begingroup$ Updated answer. But if you manually turn some of them on and some of them off, and then use this, you will get some kind of wonky behaviour. I guess that is the reason there is no standard hotkey for this. $\endgroup$ Commented Sep 26, 2016 at 13:13
  • $\begingroup$ Updated my answer to reflect this. If no subsurf modifier is present, a new one will be created. To avoid the wonky behaviour we can create a custom flag to save the state, just let me know... $\endgroup$
    – p2or
    Commented Sep 26, 2016 at 16:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .