78498f636ef6896b9a4b7760b76057b7e76889fd
[blender-addons-contrib.git] / space_view3d_stored_views / properties.py
1 # gpl authors: nfloyd, Francesco Siddi
2
3 from bpy.types import PropertyGroup
4 from bpy.props import (
5         BoolProperty,
6         BoolVectorProperty,
7         CollectionProperty,
8         FloatProperty,
9         FloatVectorProperty,
10         EnumProperty,
11         IntProperty,
12         IntVectorProperty,
13         PointerProperty,
14         StringProperty,
15         )
16
17
18 class POVData(PropertyGroup):
19     distance: FloatProperty()
20     location: FloatVectorProperty(
21             subtype='TRANSLATION'
22             )
23     rotation: FloatVectorProperty(
24             subtype='QUATERNION',
25             size=4
26             )
27     name: StringProperty()
28     perspective: EnumProperty(
29             items=[('PERSP', '', ''),
30                    ('ORTHO', '', ''),
31                    ('CAMERA', '', '')]
32             )
33     lens: FloatProperty()
34     clip_start: FloatProperty()
35     clip_end: FloatProperty()
36     lock_cursor: BoolProperty()
37     cursor_location: FloatVectorProperty()
38     perspective_matrix_md5: StringProperty()
39     camera_name: StringProperty()
40     camera_type: StringProperty()
41     lock_object_name: StringProperty()
42
43
44 class LayersData(PropertyGroup):
45     view_layers = BoolVectorProperty(size=20)
46     scene_layers = BoolVectorProperty(size=20)
47     lock_camera_and_layers: BoolProperty()
48     name: StringProperty()
49
50
51 class DisplayData(PropertyGroup):
52     name: StringProperty()
53     viewport_shade: EnumProperty(
54             items=[('BOUNDBOX', 'BOUNDBOX', 'BOUNDBOX'),
55                    ('WIREFRAME', 'WIREFRAME', 'WIREFRAME'),
56                    ('SOLID', 'SOLID', 'SOLID'),
57                    ('TEXTURED', 'TEXTURED', 'TEXTURED'),
58                    ('MATERIAL', 'MATERIAL', 'MATERIAL'),
59                    ('RENDERED', 'RENDERED', 'RENDERED')]
60             )
61     show_only_render: BoolProperty()
62     show_outline_selected: BoolProperty()
63     show_all_objects_origin: BoolProperty()
64     show_relationship_lines: BoolProperty()
65     show_floor: BoolProperty()
66     show_axis_x: BoolProperty()
67     show_axis_y: BoolProperty()
68     show_axis_z: BoolProperty()
69     grid_lines: IntProperty()
70     grid_scale: FloatProperty()
71     grid_subdivisions: IntProperty()
72     material_mode: StringProperty()
73     show_textured_solid: BoolProperty()
74     quad_view: BoolProperty()
75     lock_rotation: BoolProperty()
76     show_sync_view: BoolProperty()
77     use_box_clip: BoolProperty()
78
79
80 class ViewData(PropertyGroup):
81     pov: PointerProperty(
82             type=POVData
83             )
84     layers: PointerProperty(
85             type=LayersData
86             )
87     display: PointerProperty(
88             type=DisplayData
89             )
90     name: StringProperty()
91
92
93 class StoredViewsData(PropertyGroup):
94     pov_list: CollectionProperty(
95             type=POVData
96             )
97     layers_list: CollectionProperty(
98             type=LayersData
99             )
100     display_list: CollectionProperty(
101             type=DisplayData
102             )
103     view_list: CollectionProperty(
104             type=ViewData
105             )
106     mode: EnumProperty(
107             name="Mode",
108             items=[('VIEW', "View", "3D View settings"),
109                    ('POV', "POV", "POV settings"),
110                    ('LAYERS', "Layers", "Layers settings"),
111                    ('DISPLAY', "Display", "Display settings")],
112             default='VIEW'
113             )
114     current_indices: IntVectorProperty(
115             size=4,
116             default=[-1, -1, -1, -1]
117             )
118     view_modified: BoolProperty(
119             default=False
120             )