- Home /
How to save scene view camera perspectives.
For my project, I need to constantly switch back and forth between 2 specific camera perspectives in the editor in scene view, is there a way to save them so I can easily switch?
Answer by Bunny83 · Jun 07, 2018 at 11:54 PM
Well, the easiest solution is to just open another sceneview. You can dock them in the same tab view so you can just switch between the two or even more than two by clicking on the corresponding tab.
However if you want more control over your saved points you can use this little editor script i just made. With CTRL+ALT+P you can enable / disable the controls in the sceneview. The control window can be expanded / collapsed and moved around in the sceneview. You can add as many presets you like. The presets as well as all the settings are stored as json in the editorprefs as a single string.
edit
I just added some more features to this editor script. Each preset now has a context menu to edit the preset and general settings. I've added a way to re-order the presets and to export the settings to a file in case you want to move it to another machine. You can also additively import only the presets from an exported save. Furthermore i've added a visualization of the camera positions and their pivots when holding down CTRL. This can be disabled. Also there's now a toggle in the Tools menu on the top.
If you find any problems with this script, feel free to leave a comment.
ps: Since it's an editor script it need to be placed in a folder called "editor".
Wow, I didn't even know you can have more than 1 scene view window, that's going to come very handy.
I'll check out your script as well, thanks a ton!
Just edited the script to support 2d and ortho views
This script is great thanks Bunny.
If you are taking requests, It would be super useful to allow the preset titles to be hyperlinks. In my use case I have photos that I am working from. If the title could also be a link - I could open http:// or file:// reference photos. But I could also imagine people using it to link to text notes.
Thanks again!
That sounds a bit strange. This is an editor tool to manage different editor scene view camera positions. Why would you need a hyperlink as the name? Even if such a feature would be built in.an http / https link is quite different from a file URI. Do you actually want to reference a Texture2D inside your project? or an external file? What exactly should "open" when you click on that "link". Also there isn't really a lot of space in that presets "window". So a whole link would be total overkill. Also the title is currently shown on a button which actually restores the camera settings. Do you want to have that link "opened" at the same time? Everytime when you click on the button? That's even stranger.
Sorry, I should have been more clearer. I wrote that very late.
In my scenario, I am working from reference photographs recreating the real world. It would be helpful if I could directly open a bookmarked photo alongside the preset view - ins$$anonymous$$d of having to open up explorer and browse for the file. Not incredibly important but it would save some time. If I was working with a $$anonymous$$m, I might use a link to a text file or Trello card that would store notes.
It would mean adding another button (or separating the title from an open button), which would take away the elegant simplicity of your solution though.
@Bunny83 This looks like exactly the type of scene view saver I've been wishing for. Thanks! However, I'm having issues getting it to run. I saved the script into a 'Editor' folder within 'Assets'. 'B83' appears in the 'Tools' menu bar drop down. 'Toggle SceneView Presets' appears when 'B83' is selected. But that's all that happens. No additional windows appear. Using 2019.3.3f1 Any thoughts?
Update: replacing the following in the script makes the window appear. replace: //SceneView.onSceneGUIDelegate += OnSceneView; with: SceneView.duringSceneGui += OnSceneView;
I haven't looked at my little tool for quite some time now. Yes, it seems Unity has replaced the old "onSceneGUIDelegate" event with multiple events which are called at different times during a sceneview repaint. The event "duringSceneGui" seems to be the most suitable replacement. Currently I don't have time to test it but I can update my script. Thanks for the testing and pointing out that compatibility issue ^^.
Answer by Grizmu · Jul 23, 2019 at 02:16 PM
I've released a plugin called VoltGizmos, which allows saving scene view camera, gizmo and icon settings, and easily toggle between them.
You can check this video for comparison between default workflow and VoltGizmos: Video
Still if you don't need all those features, and want to do it yourself, all SceneView camera settings are stored in: Click You can create your own ScriptableObject with a custom editor, which has Save/Load buttons. Use those buttons to save/load the current settings of the SceneView.