1 # SPDX-License-Identifier: GPL-2.0-or-later
4 "name": "Stored Views",
5 "description": "Save and restore User defined views, pov, layers and display configs",
6 "author": "nfloyd, Francesco Siddi",
9 "location": "View3D > Sidebar > View > Stored Views",
11 "doc_url": "{BLENDER_MANUAL_URL}/addons/3d_view/stored_views.html",
18 import/export functionality is mostly based
19 on Bart Crouch's Theme Manager Addon
21 TODO: quadview complete support : investigate. Where's the data?
22 TODO: lock_camera_and_layers. investigate usage
25 NOTE: logging setup has to be provided by the user in a separate config file
26 as Blender will not try to configure logging by default in an add-on
27 The Config File should be in the Blender Config folder > /scripts/startup/config_logging.py
28 For setting up /location of the config folder see:
29 https://docs.blender.org/manual/en/latest/getting_started/
30 installing/configuration/directories.html
31 For configuring logging itself in the file, general Python documentation should work
32 As the logging calls are not configured, they can be kept in the other modules of this add-on
33 and will not have output until the logging configuration is set up
36 # if "bpy" in locals():
38 # importlib.reload(core)
39 # importlib.reload(ui)
40 # importlib.reload(properties)
41 # importlib.reload(operators)
42 # importlib.reload(io)
47 from . import properties
48 from . import operators
52 from bpy
.props
import (
57 from bpy
.types
import (
63 class VIEW3D_stored_views_initialize(Operator
):
64 bl_idname
= "view3d.stored_views_initialize"
65 bl_label
= "Initialize"
68 def poll(cls
, context
):
69 return not hasattr(bpy
.types
.Scene
, 'stored_views')
71 def execute(self
, context
):
72 bpy
.types
.Scene
.stored_views
= PointerProperty(
73 type=properties
.StoredViewsData
75 scenes
= bpy
.data
.scenes
77 core
.DataStore
.sanitize_data(scene
)
83 class VIEW3D_stored_views_preferences(AddonPreferences
):
86 show_exporters
: BoolProperty(
87 name
="Enable I/O Operators",
89 description
="Enable Import/Export Operations in the UI:\n"
90 "Import Stored Views preset,\n"
91 "Export Stored Views preset and \n"
92 "Import stored views from scene",
94 view_3d_update_rate
: IntProperty(
95 name
="3D view update",
96 description
="Update rate of the 3D view redraw\n"
97 "Increase the value if the UI feels sluggish",
102 def draw(self
, context
):
105 row
= layout
.row(align
=True)
106 row
.prop(self
, "view_3d_update_rate", toggle
=True)
107 row
.prop(self
, "show_exporters", toggle
=True)
112 properties
.register()
115 bpy
.utils
.register_class(VIEW3D_stored_views_initialize
)
116 bpy
.utils
.register_class(VIEW3D_stored_views_preferences
)
121 properties
.unregister()
122 operators
.unregister()
124 bpy
.utils
.unregister_class(VIEW3D_stored_views_initialize
)
125 bpy
.utils
.unregister_class(VIEW3D_stored_views_preferences
)
126 ui
.VIEW3D_stored_views_draw
.handle_remove(bpy
.context
)
127 if hasattr(bpy
.types
.Scene
, "stored_views"):
128 del bpy
.types
.Scene
.stored_views
131 if __name__
== "__main__":