Relating to this recent thread, this is something I have been meaning to script for myself for awhile, so this gave me an excuse to do it. The following two Python scripts set one or more objects to one of the display modes available - but in all viewports simultaneously. There are two versions - the first one will give you a listbox with all the display modes available and ask you to chose, the second is a “fixed” version where the display mode is hard-coded and thus represents a one-click solution.
In the second case you will need to edit the script to put in the name of the display mode you want to activate (I put in the most common ones, you can change which lines are commented out). Make sure that the display mode is actually present and that the localized name is spelled correctly.
Apologies to the Mac people, the listbox version will not run yet, if I have time I will create a command box string-based version later. Current version now both Mac and Windows compatible, please re-download…! (thanks to Jeff Hammond for testing)
As usual, please report any bugs/failures and/or computer meltdowns
–Mitch
SetObjDisplayModeAllViewports.py (1.7 KB)
SetSpecificObjDisplayModeAllViewports.py (1.4 KB)
Edit #1: assigning Technical display mode or a variation of it to an object does not seem to be working, so beware. I guess this is because Technical has its own display pipeline - I see it is excluded from the normal SetObjectDisplayMode command as well… I revised the script to exclude these as well.
Edit #2: having unleashed this potentially poisonous tool, I had better also supply the antidote - a tool to remove any special display modes from a set of objects in all viewports…
RemSpecificObjDisplayModeAllViewports.py (782 Bytes)