for rendering I need to load the initial view of the current named viewport often after I manipulated objects and materials. It are quite a lot clicks through menus to load the current view again. Couldn’t a quick access be implement, for example per right mouse button double click on the viewport name?
Hmm. is that a thing? RMB double-click? Here is a Python that may help, for now:
import scriptcontext as sc
def RestoreNamedView():
vp = sc.doc.Views.ActiveView.ActiveViewport
name = vp.Name
for n in range(sc.doc.NamedViews.Count):
if sc.doc.NamedViews[n].Name == name:
sc.doc.NamedViews.Restore(n,vp)
sc.doc.Views.Redraw()
break
if __name__ == '__main__':RestoreNamedView()
if you have named the views with numbers you can reload them just typing the number and enter.
I often use 1, 2 or 3 in the perspective view to do this.
@pascal A button script could be a nice first aid for the workflow. But it doesn’t run here. Is something wrong here:
! _-RunPythonScript (
import scriptcontext as sc
def RestoreNamedView():
vp = sc.doc.Views.ActiveView.ActiveViewport
name = vp.Name
for n in range(sc.doc.NamedViews.Count):
if sc.doc.NamedViews[n].Name == name:
sc.doc.NamedViews.Restore(n,vp)
sc.doc.Views.Redraw()
break
if name == ‘main’:RestoreNamedView()
)
For the feature wish - a single LMB click on the viewport name could do the job too, it’s not used yet. Maybe it’s better the RMB double click.
Also interesting could be to change the blue-grey name color to an other color like orange if the viewport doesn’t show the saved perspective anymore. So, the render users could see, if the perspective is not 100% right anymore.
@Micha, maybe this will come handy - a script that restores the title view. I use is all the time, and have it on a handy keyboard shortcut. It could be done as an alias as well so you can run it while in-command:
(ignore the intro to my post - the complaint has been resolved now)
EDIT: I missed @Pascal’s script post - I guess then you have a solution there already.
Also in Rhino 7, there now is an * next to the name of the view when that no longer is the same as the Named View.
Apart from all that, a quick way to restore Named Views (apart from using simple names such as r1, v1 or even just 1, 2, 3 as Diego does) is to have the Named Views panel open and just double-click the name.
-wim