The “Ghosted” mode UI reports “30” under “Shading Settings”.
When I run:
Rhino.Print Rhino.ViewDisplayModeProperty(Rhino.ViewDisplayModeId("Ghosted"), "Shading\Material\Front Material\Transparency")
the result is:
But here is another thing, which may be a bit more telling: the settings actually update, but the display would not reflect the change until an object is selected in the scene. Rotating the view does not help, or using Rhino.Redraw method. I actually ran into similar issue with a few other ViewDisplayMode settiings, but can’t pinpoint the pattern.
The only thing that I can force to make the update is restoring a NamedView and switching back and forth to another display mode via scripting, so I came up with this:
Private Sub RefreshDisplayMode()
'refreshed imported display mode by creating temporary named view, restoring it, switchin viewport name and other display mode for panels to refresh
Dim strCurrentMode : strCurrentMode = Rhino.ViewDisplayModeEx()
Dim vName: vName = Rhino.CurrentView(): Call Rhino.AddNamedView("TMP") : Call Rhino.RestoreNamedView("TMP") : Call Rhino.DeleteNamedView("TMP")
Call Rhino.ViewDisplayMode(, 0)
Call Rhino.ViewDisplayModeEx(, strCurrentMode)
Call Rhino.Command("_-ViewportProperties _Title " & chr(34) & vName & chr(34) & " _Enter", False)
If I run that sub after making changes to display mode the transparency (and some other settings) would refresh. I also ran into a few cases (again, no pattern) where changes made to display modes in script runtime would revert back after the script ends.
So - it seems like something is off, somewhere, with the way the displaymode updates are handled by the scripting methods. Sorry about not being able to give you a precise step-by-step how to reproduce the issues; maybe from the above you can get some clues. Ideally we would not need to use the “namedviewrestore” hack to have the changes take place instantly.