1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
20 /** \file
21  * \ingroup DNA
22  */
23 
24 #pragma once
25 
26 struct BoundBox;
27 struct Object;
28 struct RenderEngine;
29 struct SmoothView3DStore;
30 struct SpaceLink;
31 struct ViewDepths;
32 struct bGPdata;
33 struct wmTimer;
34 
35 #include "DNA_defs.h"
36 #include "DNA_image_types.h"
37 #include "DNA_listBase.h"
38 #include "DNA_movieclip_types.h"
39 #include "DNA_object_types.h"
40 #include "DNA_view3d_enums.h"
41 
42 typedef struct RegionView3D {
43 
44   /** GL_PROJECTION matrix. */
45   float winmat[4][4];
46   /** GL_MODELVIEW matrix. */
47   float viewmat[4][4];
48   /** Inverse of viewmat. */
49   float viewinv[4][4];
50   /** Viewmat*winmat. */
51   float persmat[4][4];
52   /** Inverse of persmat. */
53   float persinv[4][4];
54   /** Offset/scale for camera glsl texcoords. */
55   float viewcamtexcofac[4];
56 
57   /** viewmat/persmat multiplied with object matrix, while drawing and selection. */
58   float viewmatob[4][4];
59   float persmatob[4][4];
60 
61   /** User defined clipping planes. */
62   float clip[6][4];
63   /** Clip in object space,
64    * means we can test for clipping in editmode without first going into worldspace. */
65   float clip_local[6][4];
66   struct BoundBox *clipbb;
67 
68   /** Allocated backup of its self while in localview. */
69   struct RegionView3D *localvd;
70   struct RenderEngine *render_engine;
71   struct ViewDepths *depths;
72 
73   /** Animated smooth view. */
74   struct SmoothView3DStore *sms;
75   struct wmTimer *smooth_timer;
76 
77   /** Transform gizmo matrix. */
78   float twmat[4][4];
79   /** min/max dot product on twmat xyz axis. */
80   float tw_axis_min[3], tw_axis_max[3];
81   float tw_axis_matrix[3][3];
82 
83   float gridview DNA_DEPRECATED;
84 
85   /** View rotation, must be kept normalized. */
86   float viewquat[4];
87   /** Distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs'. */
88   float dist;
89   /** Camera view offsets, 1.0 = viewplane moves entire width/height. */
90   float camdx, camdy;
91   /** Runtime only. */
92   float pixsize;
93   /**
94    * View center & orbit pivot, negative of worldspace location,
95    * also matches -viewinv[3][0:3] in ortho mode.
96    */
97   float ofs[3];
98   /** Viewport zoom on the camera frame, see BKE_screen_view3d_zoom_to_fac. */
99   float camzoom;
100   /**
101    * Check if persp/ortho view, since 'persp' cant be used for this since
102    * it can have cameras assigned as well. (only set in #view3d_winmatrix_set)
103    */
104   char is_persp;
105   char persp;
106   char view;
107   char view_axis_roll;
108   char viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
109   /** Options for runtime only locking (cleared on file read) */
110   char runtime_viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
111   /** Options for quadview (store while out of quad view). */
112   char viewlock_quad;
113   char _pad[1];
114   /** Normalized offset for locked view: (-1, -1) bottom left, (1, 1) upper right. */
115   float ofs_lock[2];
116 
117   /** XXX can easily get rid of this (Julian). */
118   short twdrawflag;
119   short rflag;
120 
121   /** Last view (use when switching out of camera view). */
122   float lviewquat[4];
123   /** Lpersp can never be set to 'RV3D_CAMOB'. */
124   char lpersp;
125   char lview;
126   char lview_axis_roll;
127   char _pad8[1];
128 
129   /** Active rotation from NDOF or elsewhere. */
130   float rot_angle;
131   float rot_axis[3];
132 } RegionView3D;
133 
134 typedef struct View3DCursor {
135   float location[3];
136 
137   float rotation_quaternion[4];
138   float rotation_euler[3];
139   float rotation_axis[3], rotation_angle;
140   short rotation_mode;
141 
142   char _pad[6];
143 } View3DCursor;
144 
145 /** 3D Viewport Shading settings. */
146 typedef struct View3DShading {
147   /** Shading type (OB_SOLID, ..). */
148   char type;
149   /** Runtime, for toggle between rendered viewport. */
150   char prev_type;
151   char prev_type_wire;
152 
153   char color_type;
154   short flag;
155 
156   char light;
157   char background_type;
158   char cavity_type;
159   char wire_color_type;
160   char _pad[2];
161 
162   /** FILE_MAXFILE. */
163   char studio_light[256];
164   /** FILE_MAXFILE. */
165   char lookdev_light[256];
166   /** FILE_MAXFILE. */
167   char matcap[256];
168 
169   float shadow_intensity;
170   float single_color[3];
171 
172   float studiolight_rot_z;
173   float studiolight_background;
174   float studiolight_intensity;
175   float studiolight_blur;
176 
177   float object_outline_color[3];
178   float xray_alpha;
179   float xray_alpha_wire;
180 
181   float cavity_valley_factor;
182   float cavity_ridge_factor;
183 
184   float background_color[3];
185 
186   float curvature_ridge_factor;
187   float curvature_valley_factor;
188 
189   /* Render pass displayed in the viewport. Is an `eScenePassType` where one bit is set */
190   int render_pass;
191 
192   struct IDProperty *prop;
193   void *_pad2;
194 } View3DShading;
195 
196 /** 3D Viewport Overlay settings. */
197 typedef struct View3DOverlay {
198   int flag;
199 
200   /** Edit mode settings. */
201   int edit_flag;
202   float normals_length;
203   float backwire_opacity;
204 
205   /** Paint mode settings. */
206   int paint_flag;
207 
208   /** Weight paint mode settings. */
209   int wpaint_flag;
210 
211   /** Alpha for texture, weight, vertex paint overlay. */
212   float texture_paint_mode_opacity;
213   float vertex_paint_mode_opacity;
214   float weight_paint_mode_opacity;
215   float sculpt_mode_mask_opacity;
216   float sculpt_mode_face_sets_opacity;
217 
218   /** Armature edit/pose mode settings. */
219   float xray_alpha_bone;
220 
221   /** Darken Inactive. */
222   float fade_alpha;
223 
224   /** Other settings. */
225   float wireframe_threshold;
226 
227   /** Grease pencil settings. */
228   float gpencil_paper_opacity;
229   float gpencil_grid_opacity;
230   float gpencil_fade_layer;
231 
232   /** Factor for mixing vertex paint with original color */
233   float gpencil_vertex_paint_opacity;
234   /** Handles display type for curves. */
235   int handle_display;
236   char _pad[4];
237 } View3DOverlay;
238 
239 /* View3DOverlay->handle_display */
240 typedef enum eHandleDisplay {
241   /* Display only selected points. */
242   CURVE_HANDLE_SELECTED = 0,
243   /* Display all handles. */
244   CURVE_HANDLE_ALL = 1,
245   /* No display handles. */
246   CURVE_HANDLE_NONE = 2,
247 } eHandleDisplay;
248 
249 typedef struct View3D_Runtime {
250   /** Nkey panel stores stuff here. */
251   void *properties_storage;
252   /** Runtime only flags. */
253   int flag;
254 
255   char _pad1[4];
256 } View3D_Runtime;
257 
258 /** 3D ViewPort Struct. */
259 typedef struct View3D {
260   struct SpaceLink *next, *prev;
261   /** Storage of regions for inactive spaces. */
262   ListBase regionbase;
263   char spacetype;
264   char link_flag;
265   char _pad0[6];
266   /* End 'SpaceLink' header. */
267 
268   float viewquat[4] DNA_DEPRECATED;
269   float dist DNA_DEPRECATED;
270 
271   /** Size of bundles in reconstructed data. */
272   float bundle_size;
273   /** Display style for bundle. */
274   char bundle_drawtype;
275 
276   char drawtype DNA_DEPRECATED;
277 
278   char _pad3[1];
279 
280   /** Multiview current eye - for internal use. */
281   char multiview_eye;
282 
283   int object_type_exclude_viewport;
284   int object_type_exclude_select;
285 
286   short persp DNA_DEPRECATED;
287   short view DNA_DEPRECATED;
288 
289   struct Object *camera, *ob_center;
290   rctf render_border;
291 
292   /** Allocated backup of its self while in localview. */
293   struct View3D *localvd;
294 
295   /** Optional string for armature bone to define center, MAXBONENAME. */
296   char ob_center_bone[64];
297 
298   unsigned short local_view_uuid;
299   char _pad6[2];
300   int layact DNA_DEPRECATED;
301   unsigned short local_collections_uuid;
302   short _pad7[3];
303 
304   /** Optional bool for 3d cursor to define center. */
305   short ob_center_cursor;
306   short scenelock;
307   short gp_flag;
308   short flag;
309   int flag2;
310 
311   float lens, grid;
312   float clip_start, clip_end;
313   float ofs[3] DNA_DEPRECATED;
314 
315   char _pad[1];
316 
317   /** Transform gizmo info. */
318   /** #V3D_GIZMO_SHOW_* */
319   char gizmo_flag;
320 
321   char gizmo_show_object;
322   char gizmo_show_armature;
323   char gizmo_show_empty;
324   char gizmo_show_light;
325   char gizmo_show_camera;
326 
327   char gridflag;
328 
329   short gridlines;
330   /** Number of subdivisions in the grid between each highlighted grid line. */
331   short gridsubdiv;
332 
333   /** Actually only used to define the opacity of the grease pencil vertex in edit mode. */
334   float vertex_opacity;
335 
336   /* XXX deprecated? */
337   /** Grease-Pencil Data (annotation layers). */
338   struct bGPdata *gpd DNA_DEPRECATED;
339 
340   /** Stereoscopy settings. */
341   short stereo3d_flag;
342   char stereo3d_camera;
343   char _pad4;
344   float stereo3d_convergence_factor;
345   float stereo3d_volume_alpha;
346   float stereo3d_convergence_alpha;
347 
348   /** Display settings. */
349   View3DShading shading;
350   View3DOverlay overlay;
351 
352   /** Runtime evaluation data (keep last). */
353   View3D_Runtime runtime;
354 } View3D;
355 
356 /** #View3D.stereo3d_flag */
357 #define V3D_S3D_DISPCAMERAS (1 << 0)
358 #define V3D_S3D_DISPPLANE (1 << 1)
359 #define V3D_S3D_DISPVOLUME (1 << 2)
360 
361 /** #View3D.flag */
362 #define V3D_LOCAL_COLLECTIONS (1 << 0)
363 #define V3D_FLAG_UNUSED_1 (1 << 1) /* cleared */
364 #define V3D_HIDE_HELPLINES (1 << 2)
365 #define V3D_INVALID_BACKBUF (1 << 3)
366 #define V3D_XR_SESSION_MIRROR (1 << 4)
367 
368 #define V3D_FLAG_UNUSED_10 (1 << 10) /* cleared */
369 #define V3D_SELECT_OUTLINE (1 << 11)
370 #define V3D_FLAG_UNUSED_12 (1 << 12) /* cleared */
371 #define V3D_GLOBAL_STATS (1 << 13)
372 #define V3D_DRAW_CENTERS (1 << 15)
373 
374 /** #View3D_Runtime.flag */
375 enum {
376   /** The 3D view which the XR session was created in is flagged with this. */
377   V3D_RUNTIME_XR_SESSION_ROOT = (1 << 0),
378 };
379 
380 /** #RegionView3D.persp */
381 #define RV3D_ORTHO 0
382 #define RV3D_PERSP 1
383 #define RV3D_CAMOB 2
384 
385 /** #RegionView3D.rflag */
386 #define RV3D_CLIPPING (1 << 2)
387 #define RV3D_NAVIGATING (1 << 3)
388 #define RV3D_GPULIGHT_UPDATE (1 << 4)
389 #define RV3D_PAINTING (1 << 5)
390 /*#define RV3D_IS_GAME_ENGINE       (1 << 5) */ /* UNUSED */
391 /**
392  * Disable zbuffer offset, skip calls to #ED_view3d_polygon_offset.
393  * Use when precise surface depth is needed and picking bias isn't, see T45434).
394  */
395 #define RV3D_ZOFFSET_DISABLED 64
396 
397 /** #RegionView3D.viewlock */
398 enum {
399   RV3D_LOCK_ROTATION = (1 << 0),
400   RV3D_BOXVIEW = (1 << 1),
401   RV3D_BOXCLIP = (1 << 2),
402   RV3D_LOCK_LOCATION = (1 << 3),
403   RV3D_LOCK_ZOOM_AND_DOLLY = (1 << 4),
404 
405   RV3D_LOCK_ANY_TRANSFORM = (RV3D_LOCK_LOCATION | RV3D_LOCK_ROTATION | RV3D_LOCK_ZOOM_AND_DOLLY),
406 };
407 
408 /* Bitwise OR of the regular lock-flags with runtime only lock-flags. */
409 #define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
410 
411 /** #RegionView3D.viewlock_quad */
412 #define RV3D_VIEWLOCK_INIT (1 << 7)
413 
414 /** #RegionView3D.view */
415 #define RV3D_VIEW_USER 0
416 #define RV3D_VIEW_FRONT 1
417 #define RV3D_VIEW_BACK 2
418 #define RV3D_VIEW_LEFT 3
419 #define RV3D_VIEW_RIGHT 4
420 #define RV3D_VIEW_TOP 5
421 #define RV3D_VIEW_BOTTOM 6
422 #define RV3D_VIEW_CAMERA 8
423 
424 #define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
425 
426 /**
427  * #RegionView3D.view_axis_roll
428  *
429  * Clockwise rotation to use for axis-views, when #RV3D_VIEW_IS_AXIS is true.
430  */
431 enum {
432   RV3D_VIEW_AXIS_ROLL_0 = 0,
433   RV3D_VIEW_AXIS_ROLL_90 = 1,
434   RV3D_VIEW_AXIS_ROLL_180 = 2,
435   RV3D_VIEW_AXIS_ROLL_270 = 3,
436 };
437 
438 #define RV3D_CLIPPING_ENABLED(v3d, rv3d) \
439   ((rv3d) && (v3d) && ((rv3d)->rflag & RV3D_CLIPPING) && \
440    ELEM((v3d)->shading.type, OB_WIRE, OB_SOLID) && (rv3d)->clipbb)
441 
442 /** #View3D.flag2 (int) */
443 #define V3D_HIDE_OVERLAYS (1 << 2)
444 #define V3D_FLAG2_UNUSED_3 (1 << 3) /* cleared */
445 #define V3D_SHOW_ANNOTATION (1 << 4)
446 #define V3D_LOCK_CAMERA (1 << 5)
447 #define V3D_FLAG2_UNUSED_6 (1 << 6) /* cleared */
448 #define V3D_SHOW_RECONSTRUCTION (1 << 7)
449 #define V3D_SHOW_CAMERAPATH (1 << 8)
450 #define V3D_SHOW_BUNDLENAME (1 << 9)
451 #define V3D_FLAG2_UNUSED_10 (1 << 10) /* cleared */
452 #define V3D_RENDER_BORDER (1 << 11)
453 #define V3D_FLAG2_UNUSED_12 (1 << 12) /* cleared */
454 #define V3D_FLAG2_UNUSED_13 (1 << 13) /* cleared */
455 #define V3D_FLAG2_UNUSED_14 (1 << 14) /* cleared */
456 #define V3D_FLAG2_UNUSED_15 (1 << 15) /* cleared */
457 
458 /** #View3D.gp_flag (short) */
459 #define V3D_GP_FADE_OBJECTS (1 << 0) /* Fade all non GP objects */
460 #define V3D_GP_SHOW_GRID (1 << 1)    /* Activate paper grid */
461 #define V3D_GP_SHOW_EDIT_LINES (1 << 2)
462 #define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 3)
463 #define V3D_GP_SHOW_ONION_SKIN (1 << 4)       /* main switch at view level */
464 #define V3D_GP_FADE_NOACTIVE_LAYERS (1 << 5)  /* fade layers not active */
465 #define V3D_GP_FADE_NOACTIVE_GPENCIL (1 << 6) /* Fade other GPencil objects */
466 #define V3D_GP_SHOW_STROKE_DIRECTION (1 << 7) /* Show Strokes Directions */
467 #define V3D_GP_SHOW_MATERIAL_NAME (1 << 8)    /* Show Material names */
468 #define V3D_GP_SHOW_GRID_XRAY (1 << 9)        /* Show Canvas Grid on Top */
469 
470 /** #View3DShading.flag */
471 enum {
472   V3D_SHADING_OBJECT_OUTLINE = (1 << 0),
473   V3D_SHADING_XRAY = (1 << 1),
474   V3D_SHADING_SHADOW = (1 << 2),
475   V3D_SHADING_SCENE_LIGHTS = (1 << 3),
476   V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4),
477   V3D_SHADING_CAVITY = (1 << 5),
478   V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
479   V3D_SHADING_SCENE_WORLD = (1 << 7),
480   V3D_SHADING_XRAY_WIREFRAME = (1 << 8),
481   V3D_SHADING_WORLD_ORIENTATION = (1 << 9),
482   V3D_SHADING_BACKFACE_CULLING = (1 << 10),
483   V3D_SHADING_DEPTH_OF_FIELD = (1 << 11),
484   V3D_SHADING_SCENE_LIGHTS_RENDER = (1 << 12),
485   V3D_SHADING_SCENE_WORLD_RENDER = (1 << 13),
486   V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION = (1 << 14),
487 };
488 
489 /** #View3DShading.cavity_type */
490 enum {
491   V3D_SHADING_CAVITY_SSAO = 0,
492   V3D_SHADING_CAVITY_CURVATURE = 1,
493   V3D_SHADING_CAVITY_BOTH = 2,
494 };
495 
496 /** #View3DOverlay.flag */
497 enum {
498   V3D_OVERLAY_FACE_ORIENTATION = (1 << 0),
499   V3D_OVERLAY_HIDE_CURSOR = (1 << 1),
500   V3D_OVERLAY_BONE_SELECT = (1 << 2),
501   V3D_OVERLAY_LOOK_DEV = (1 << 3),
502   V3D_OVERLAY_WIREFRAMES = (1 << 4),
503   V3D_OVERLAY_HIDE_TEXT = (1 << 5),
504   V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
505   V3D_OVERLAY_ONION_SKINS = (1 << 7),
506   V3D_OVERLAY_HIDE_BONES = (1 << 8),
507   V3D_OVERLAY_HIDE_OBJECT_XTRAS = (1 << 9),
508   V3D_OVERLAY_HIDE_OBJECT_ORIGINS = (1 << 10),
509   V3D_OVERLAY_STATS = (1 << 11),
510   V3D_OVERLAY_FADE_INACTIVE = (1 << 12),
511 };
512 
513 /** #View3DOverlay.edit_flag */
514 enum {
515   V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
516   V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
517   V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
518 
519   V3D_OVERLAY_EDIT_OCCLUDE_WIRE = (1 << 3),
520 
521   V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
522 
523   V3D_OVERLAY_EDIT_EDGES = (1 << 5),
524   V3D_OVERLAY_EDIT_FACES = (1 << 6),
525   V3D_OVERLAY_EDIT_FACE_DOT = (1 << 7),
526 
527   V3D_OVERLAY_EDIT_SEAMS = (1 << 8),
528   V3D_OVERLAY_EDIT_SHARP = (1 << 9),
529   V3D_OVERLAY_EDIT_CREASES = (1 << 10),
530   V3D_OVERLAY_EDIT_BWEIGHTS = (1 << 11),
531 
532   V3D_OVERLAY_EDIT_FREESTYLE_EDGE = (1 << 12),
533   V3D_OVERLAY_EDIT_FREESTYLE_FACE = (1 << 13),
534 
535   V3D_OVERLAY_EDIT_STATVIS = (1 << 14),
536   V3D_OVERLAY_EDIT_EDGE_LEN = (1 << 15),
537   V3D_OVERLAY_EDIT_EDGE_ANG = (1 << 16),
538   V3D_OVERLAY_EDIT_FACE_ANG = (1 << 17),
539   V3D_OVERLAY_EDIT_FACE_AREA = (1 << 18),
540   V3D_OVERLAY_EDIT_INDICES = (1 << 19),
541 
542   /* Deprecated. */
543   /* V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),  */
544 
545   V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
546 };
547 
548 /** #View3DOverlay.paint_flag */
549 enum {
550   V3D_OVERLAY_PAINT_WIRE = (1 << 0),
551 };
552 
553 /** #View3DOverlay.wpaint_flag */
554 enum {
555   V3D_OVERLAY_WPAINT_CONTOURS = (1 << 0),
556 };
557 
558 /** #View3D.around */
559 enum {
560   /* center of the bounding box */
561   V3D_AROUND_CENTER_BOUNDS = 0,
562   /* center from the sum of all points divided by the total */
563   V3D_AROUND_CENTER_MEDIAN = 3,
564   /* pivot around the 2D/3D cursor */
565   V3D_AROUND_CURSOR = 1,
566   /* pivot around each items own origin */
567   V3D_AROUND_LOCAL_ORIGINS = 2,
568   /* pivot around the active items origin */
569   V3D_AROUND_ACTIVE = 4,
570 };
571 
572 /** #View3D.gridflag */
573 #define V3D_SHOW_FLOOR (1 << 0)
574 #define V3D_SHOW_X (1 << 1)
575 #define V3D_SHOW_Y (1 << 2)
576 #define V3D_SHOW_Z (1 << 3)
577 #define V3D_SHOW_ORTHO_GRID (1 << 4)
578 
579 /** #TransformOrientationSlot.type */
580 enum {
581   V3D_ORIENT_GLOBAL = 0,
582   V3D_ORIENT_LOCAL = 1,
583   V3D_ORIENT_NORMAL = 2,
584   V3D_ORIENT_VIEW = 3,
585   V3D_ORIENT_GIMBAL = 4,
586   V3D_ORIENT_CURSOR = 5,
587   V3D_ORIENT_CUSTOM = 1024,
588   /** Runtime only, never saved to DNA. */
589   V3D_ORIENT_CUSTOM_MATRIX = (V3D_ORIENT_CUSTOM - 1),
590 };
591 
592 /** #View3d.gizmo_flag */
593 enum {
594   /** All gizmos. */
595   V3D_GIZMO_HIDE = (1 << 0),
596   V3D_GIZMO_HIDE_NAVIGATE = (1 << 1),
597   V3D_GIZMO_HIDE_CONTEXT = (1 << 2),
598   V3D_GIZMO_HIDE_TOOL = (1 << 3),
599 };
600 
601 /** #View3d.gizmo_show_object */
602 enum {
603   V3D_GIZMO_SHOW_OBJECT_TRANSLATE = (1 << 0),
604   V3D_GIZMO_SHOW_OBJECT_ROTATE = (1 << 1),
605   V3D_GIZMO_SHOW_OBJECT_SCALE = (1 << 2),
606 };
607 /** #View3d.gizmo_show_armature */
608 enum {
609   /** Currently unused (WIP gizmo). */
610   V3D_GIZMO_SHOW_ARMATURE_BBONE = (1 << 0),
611   /** Not yet implemented. */
612   V3D_GIZMO_SHOW_ARMATURE_ROLL = (1 << 1),
613 };
614 /** #View3d.gizmo_show_empty */
615 enum {
616   V3D_GIZMO_SHOW_EMPTY_IMAGE = (1 << 0),
617   V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD = (1 << 1),
618 };
619 /** #View3d.gizmo_show_light */
620 enum {
621   /** Use for both spot & area size. */
622   V3D_GIZMO_SHOW_LIGHT_SIZE = (1 << 0),
623   V3D_GIZMO_SHOW_LIGHT_LOOK_AT = (1 << 1),
624 };
625 /** #View3d.gizmo_show_camera */
626 enum {
627   /** Also used for ortho size. */
628   V3D_GIZMO_SHOW_CAMERA_LENS = (1 << 0),
629   V3D_GIZMO_SHOW_CAMERA_DOF_DIST = (1 << 2),
630 };
631 
632 #define RV3D_CAMZOOM_MIN -30
633 #define RV3D_CAMZOOM_MAX 600
634 
635 /** #BKE_screen_view3d_zoom_to_fac() values above */
636 #define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f
637 #define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
638