Wish: Cycle between viewport modes

I have two proposals regarding adding new functionality for the viewport modes. Those two could utilize the same new icon via LMB and RMB click:

  1. Ability to toggle between the last used two viewport modes via the LMB. Example: If the last used viewport modes were Rendered, Technical, Wireframe and Shaded, this command will only toggle between Wireframe and Shaded.

  2. Ability to cycle between a custom number of viewport modes (enabling/disabling them in the Command line maybe?) via the RMB. Example: The user could set only Wireframe, Shaded, Ghosted and Technical to cycle with each press of the icon, whereas the remaining viewport modes that were not enabled in the Command line will not be included in the cycle.

This is a modified version of the original icon of the ! _SetObjectDisplayMode command. I simply added two arrows to indicate that the viewport modes could be switched via this new icon:
Cycle viewport modes

Any chance for this to be implemented in the future? :slight_smile:

why not just make buttons from -setdisplaymode ?

you can make one for each mode and assign an alias key to them or throw them in the mmb popup menu

It’s not convenient to use the MMB pop-up menu to cycle between different display modes. Also, cycling between 4 display modes will force me use 4 different keys or 2 different icons, whereas a single dedicated “Cycle display modes” button will do it all for once. :slight_smile: I already have 3 of my mouse buttons set the 3 display modes I use most often, however, in many occasions I need to switch to different display modes or between the two most recent ones.

Also, such command could benefit from using the Command line to set which and how many display modes to be repeated in the cycle, as I mentioned in proposal #2 in my original post. The idea is to be able to cycle between multiple display modes with a single key, or a mouse button or an icon. :slight_smile:

@pascal may have an idea on how to script this and assign it to a button.

1 Like

I will cogitate - should be possible.

@Rhino_Bulgaria - I can cycle modes - the hangup in a script will be making this (that is, your choices) permanent between sessions or files - all that comes to mind is writing a text file to disc - a sort of ini file - it is a bit clumsy.


1 Like

Is it possible to be able to choose which viewport modes will be active in the list and which not, by clicking in the Command line? Just like how some native Rhino commands do.

Currently I do not have it in the command line, but it could be - - I am popping up a list.


1 Like

OK, great! :slight_smile: Can’t wait to try it.

You can give this a spin - let me know what’s broken… two scripts, currently, one to set and one to cycle.

To use the Python script use RunPythonScript, or a macro:

_-RunPythonScript "Full path to py file inside double-quotes"

CycleDisplayModes.py (1.6 KB)
@Rhino_Bulgaria updated to send the user to set modes if none are saved.

SetCycleModes.py (2.4 KB)


1 Like

Wow, this works exactly as expected! Another great job, Parcal! Thank you! :slight_smile: Those new commands deserve to be a native part of Rhino 8, they are so usable. Here is how I set a new icon with LMP and RMP function to it on the main panel:

Cycle display modes

1 Like

Hi Bobi - another way to use this is to add a macro to the viewport menu - that way

If you run that once, then Enter or Space Bar to continue to cycle through, you don’t need the menu.
(BTW, I like this - good idea, @Rhino_Bulgaria )


1 Like

I figured out that I can use the Space bar to repeat the cycle between the custom selection of display modes even after I click on the icon I created with your script. :slight_smile:

As for your example with the Viewport context menu, I added it in the list and figured out how to use it. I had the context menu turned off, so I activated it now. It’s so nice that Rhino let us run commands in a few different way to suit everyone’s taste. :slight_smile:

The “Cycle display modes” script is especially useful for me as I have 3 different modifications of the default Arctic display mode, each with different amount of brightness. Since the Arctic mode is camera-dependent, the white gets really bright in close-up view, while zooming out makes everything a bit darker. This is why I made those alternative Arctic display modes to change the brightness accordingly.

(For what it is worth, I think the default menu delay of 250 ms is just a little to long to be comfortable - I have mine at 150)


Mine was set to 50, but I just increased it to 100. :slight_smile:

I noticed that while the pop-up menu appears the mouse still selects the object behind, even though I click with the RMB. It’s a bit confusing, because it’s not supposed to select the object. It’s even “funny” that if there are multiple objects behind the mouse pointer, holding down the RMB will actually evoke the “Selection menu” pop-up list instead of the “Context menu”.

I see that - looks wrong to me, I’ll check with Mikko, thanks.
RH-69554 Selection: conflict with context menu


1 Like

Yes, looks like a bug to me.