1 # SPDX-FileCopyrightText: 2017-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 "name": "Stored Views",
7 "description": "Save and restore User defined views, pov, layers and display configs",
8 "author": "nfloyd, Francesco Siddi",
10 "blender": (2, 80, 0),
11 "location": "View3D > Sidebar > View > Stored Views",
13 "doc_url": "{BLENDER_MANUAL_URL}/addons/3d_view/stored_views.html",
20 import/export functionality is mostly based
21 on Bart Crouch's Theme Manager Addon
23 TODO: quadview complete support : investigate. Where's the data?
24 TODO: lock_camera_and_layers. investigate usage
27 NOTE: logging setup has to be provided by the user in a separate config file
28 as Blender will not try to configure logging by default in an add-on
29 The Config File should be in the Blender Config folder > /scripts/startup/config_logging.py
30 For setting up /location of the config folder see:
31 https://docs.blender.org/manual/en/latest/getting_started/
32 installing/configuration/directories.html
33 For configuring logging itself in the file, general Python documentation should work
34 As the logging calls are not configured, they can be kept in the other modules of this add-on
35 and will not have output until the logging configuration is set up
38 # if "bpy" in locals():
40 # importlib.reload(core)
41 # importlib.reload(ui)
42 # importlib.reload(properties)
43 # importlib.reload(operators)
44 # importlib.reload(io)
49 from . import properties
50 from . import operators
54 from bpy
.props
import (
59 from bpy
.types
import (
65 class VIEW3D_stored_views_initialize(Operator
):
66 bl_idname
= "view3d.stored_views_initialize"
67 bl_label
= "Initialize"
70 def poll(cls
, context
):
71 return not hasattr(bpy
.types
.Scene
, 'stored_views')
73 def execute(self
, context
):
74 bpy
.types
.Scene
.stored_views
= PointerProperty(
75 type=properties
.StoredViewsData
77 scenes
= bpy
.data
.scenes
79 core
.DataStore
.sanitize_data(scene
)
85 class VIEW3D_stored_views_preferences(AddonPreferences
):
88 show_exporters
: BoolProperty(
89 name
="Enable I/O Operators",
91 description
="Enable Import/Export Operations in the UI:\n"
92 "Import Stored Views preset,\n"
93 "Export Stored Views preset and \n"
94 "Import stored views from scene",
96 view_3d_update_rate
: IntProperty(
97 name
="3D view update",
98 description
="Update rate of the 3D view redraw\n"
99 "Increase the value if the UI feels sluggish",
104 def draw(self
, context
):
107 row
= layout
.row(align
=True)
108 row
.prop(self
, "view_3d_update_rate", toggle
=True)
109 row
.prop(self
, "show_exporters", toggle
=True)
114 properties
.register()
117 bpy
.utils
.register_class(VIEW3D_stored_views_initialize
)
118 bpy
.utils
.register_class(VIEW3D_stored_views_preferences
)
123 properties
.unregister()
124 operators
.unregister()
126 bpy
.utils
.unregister_class(VIEW3D_stored_views_initialize
)
127 bpy
.utils
.unregister_class(VIEW3D_stored_views_preferences
)
128 ui
.VIEW3D_stored_views_draw
.handle_remove(bpy
.context
)
129 if hasattr(bpy
.types
.Scene
, "stored_views"):
130 del bpy
.types
.Scene
.stored_views
133 if __name__
== "__main__":