Blender V4.5
DNA_view3d_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11struct BoundBox;
12struct Object;
13struct ViewRender;
15struct SpaceLink;
16struct bGPdata;
17struct wmTimer;
18
19#ifdef __cplusplus
22#endif
23
24#include "DNA_defs.h"
25#include "DNA_image_types.h"
26#include "DNA_listBase.h"
27#include "DNA_movieclip_types.h"
28#include "DNA_object_types.h"
29#include "DNA_view3d_enums.h"
31
32typedef struct RegionView3D {
33
35 float winmat[4][4];
37 float viewmat[4][4];
39 float viewinv[4][4];
41 float persmat[4][4];
43 float persinv[4][4];
46
48 float viewmatob[4][4];
49 float persmatob[4][4];
50
52 float clip[6][4];
57 float clip_local[6][4];
59
63
67
69 float twmat[4][4];
72 float tw_axis_matrix[3][3];
73
74 float gridview DNA_DEPRECATED;
75
77 float viewquat[4];
85 float dist;
87 float camdx, camdy;
89 float pixsize;
94 float ofs[3];
96 float camzoom;
102 char persp;
103 char view;
105 char viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
107 char runtime_viewlock; /* Should usually be accessed with RV3D_LOCK_FLAGS()! */
110 char _pad[1];
112 float ofs_lock[2];
113
116 short rflag;
117
119 float lviewquat[4];
121 char lpersp;
122 char lview;
124 char _pad8[4];
125
132 float ndof_ofs[3];
133
138
139typedef struct View3DCursor {
140 float location[3];
141
146
147 char _pad[6];
148
149#ifdef __cplusplus
150 template<typename T> T matrix() const;
151 blender::math::Quaternion rotation() const;
152
153 void set_rotation(const blender::math::Quaternion &quat, bool use_compat);
154 void set_matrix(const blender::float3x3 &mat, bool use_compat);
155 void set_matrix(const blender::float4x4 &mat, bool use_compat);
156#endif
158
160typedef struct View3DShading {
162 char type;
166
168 short flag;
169
170 char light;
174
177
178 char _pad;
179
180 char studio_light[/*FILE_MAXFILE*/ 256];
181 char lookdev_light[/*FILE_MAXFILE*/ 256];
182 char matcap[/*FILE_MAXFILE*/ 256];
183
185 float single_color[3];
186
191
195
198
200
203
204 /* Render pass displayed in the viewport. Is an `eScenePassType` where one bit is set */
206 char aov_name[64];
207
209 void *_pad2;
211
266
268typedef enum eHandleDisplay {
269 /* Display only selected points. */
271 /* Display all handles. */
273 /* No display handles. */
276
277typedef struct View3D_Runtime {
282 int flag;
283
284 char _pad1[4];
285 /* Only used for overlay stats while in local-view. */
288
290typedef struct View3D {
292
293 struct SpaceLink *next, *prev;
298 char _pad0[6];
299 /* End 'SpaceLink' header. */
300
301 float viewquat[4] DNA_DEPRECATED;
302 float dist DNA_DEPRECATED;
303
308
309 char drawtype DNA_DEPRECATED;
310
311 char _pad3[1];
312
315
318
319 short persp DNA_DEPRECATED;
321
324
327
329 char ob_center_bone[/*MAXBONENAME*/ 64];
330
331 unsigned short local_view_uid;
332 char _pad6[2];
333 int layact DNA_DEPRECATED;
334 unsigned short local_collections_uid;
335 short _pad7[2];
336
338
342 short gp_flag;
343 short flag;
344 int flag2;
345
346 float lens, grid;
348 float ofs[3] DNA_DEPRECATED;
349
350 char _pad[1];
351
355
361
363
367
370
371 /* XXX deprecated? */
374
378 char _pad4;
382
386
389
393
395enum {
399};
400
402enum {
404 V3D_FLAG_UNUSED_1 = 1 << 1, /* cleared */
406 V3D_FLAG_UNUSED_2 = 1 << 3, /* cleared */
409
410 V3D_FLAG_UNUSED_10 = 1 << 10, /* cleared */
412 V3D_FLAG_UNUSED_12 = 1 << 12, /* cleared */
415};
416
418enum {
425};
426
428enum {
432};
433
435enum {
440 // RV3D_IS_GAME_ENGINE = 1 << 5, /* UNUSED */
446};
447
449enum {
457 RV3D_BOXVIEW = (1 << 1),
458 RV3D_BOXCLIP = (1 << 2),
461
463};
464
466#define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
467
469enum {
471};
472
474enum {
483};
484
485#define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
486
492enum {
497};
498
500enum {
516};
517
518#define RV3D_CLIPPING_ENABLED(v3d, rv3d) \
519 ((rv3d) && (v3d) && ((rv3d)->rflag & RV3D_CLIPPING) && \
520 ELEM((v3d)->shading.type, OB_WIRE, OB_SOLID) && (rv3d)->clipbb)
521
523enum {
528 V3D_FLAG2_UNUSED_6 = 1 << 6, /* cleared */
532 V3D_FLAG2_UNUSED_10 = 1 << 10, /* cleared */
534 V3D_FLAG2_UNUSED_12 = 1 << 12, /* cleared */
535 V3D_FLAG2_UNUSED_13 = 1 << 13, /* cleared */
536 V3D_FLAG2_UNUSED_14 = 1 << 14, /* cleared */
537 V3D_FLAG2_UNUSED_15 = 1 << 15, /* cleared */
543};
544
546enum {
569};
570
572enum {
588};
589
591enum {
593};
594
595#define V3D_USES_SCENE_LIGHTS(v3d) \
596 ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \
597 (((v3d)->shading.type == OB_RENDER) && \
598 ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))
599
600#define V3D_USES_SCENE_WORLD(v3d) \
601 ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \
602 (((v3d)->shading.type == OB_RENDER) && \
603 ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))
604
606enum {
610};
611
620
622enum {
634 V3D_OVERLAY_STATS = (1 << 11),
642};
643
645enum {
649
651
653
657
662
665
672
673 /* Deprecated. */
674 // V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
675
678};
679
681enum {
683};
684
686enum {
688};
689
691enum {
692 /* center of the bounding box */
694 /* center from the sum of all points divided by the total */
696 /* pivot around the 2D/3D cursor */
698 /* pivot around each items own origin */
700 /* pivot around the active items origin */
702};
703
705enum {
707 V3D_SHOW_X = 1 << 1,
708 V3D_SHOW_Y = 1 << 2,
709 V3D_SHOW_Z = 1 << 3,
711};
712
714enum {
725};
726
728enum {
730 V3D_GIZMO_HIDE = (1 << 0),
735};
736
738enum {
742};
744enum {
749};
751enum {
754};
756enum {
760};
762enum {
766};
767
774
779
780#define RV3D_CAMZOOM_MIN -30
781#define RV3D_CAMZOOM_MAX 600
782
784#define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f
785#define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
These structs are the foundation for all linked lists in the library system.
Object is a sort of wrapper for general info.
eV3DPlaceOrient
@ V3D_PLACE_ORIENT_DEFAULT
@ V3D_PLACE_ORIENT_SURFACE
View3DShadingUseCompositor
@ V3D_SHADING_USE_COMPOSITOR_CAMERA
@ V3D_SHADING_USE_COMPOSITOR_DISABLED
@ V3D_SHADING_USE_COMPOSITOR_ALWAYS
@ V3D_DEBUG_FREEZE_CULLING
@ RV3D_CAMOB
@ RV3D_PERSP
@ RV3D_ORTHO
@ V3D_GIZMO_SHOW_CAMERA_DOF_DIST
@ V3D_GIZMO_SHOW_CAMERA_LENS
@ RV3D_VIEW_AXIS_ROLL_270
@ RV3D_VIEW_AXIS_ROLL_180
@ RV3D_VIEW_AXIS_ROLL_90
@ RV3D_VIEW_AXIS_ROLL_0
@ V3D_OVERLAY_PAINT_WIRE
@ V3D_GIZMO_SHOW_EMPTY_FORCE_FIELD
@ V3D_GIZMO_SHOW_EMPTY_IMAGE
@ RV3D_VIEWLOCK_INIT
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_OVERLAY_WPAINT_CONTOURS
@ V3D_GLOBAL_STATS
@ V3D_LOCAL_COLLECTIONS
@ V3D_XR_SESSION_SURFACE
@ V3D_DRAW_CENTERS
@ V3D_FLAG_UNUSED_10
@ V3D_SELECT_OUTLINE
@ V3D_FLAG_UNUSED_1
@ V3D_XR_SESSION_MIRROR
@ V3D_FLAG_UNUSED_12
@ V3D_FLAG_UNUSED_2
@ V3D_HIDE_HELPLINES
@ V3D_OVERLAY_SCULPT_SHOW_FACE_SETS
@ V3D_OVERLAY_LOOK_DEV
@ V3D_OVERLAY_FACE_ORIENTATION
@ V3D_OVERLAY_VIEWER_ATTRIBUTE
@ V3D_OVERLAY_HIDE_OBJECT_ORIGINS
@ V3D_OVERLAY_HIDE_BONES
@ V3D_OVERLAY_HIDE_MOTION_PATHS
@ V3D_OVERLAY_WIREFRAMES
@ V3D_OVERLAY_SHOW_LIGHT_COLORS
@ V3D_OVERLAY_SCULPT_SHOW_MASK
@ V3D_OVERLAY_HIDE_OBJECT_XTRAS
@ V3D_OVERLAY_ONION_SKINS
@ V3D_OVERLAY_FADE_INACTIVE
@ V3D_OVERLAY_SCULPT_CURVES_CAGE
@ V3D_OVERLAY_VIEWER_ATTRIBUTE_TEXT
@ V3D_OVERLAY_HIDE_CURSOR
@ V3D_OVERLAY_HIDE_TEXT
@ V3D_OVERLAY_STATS
@ V3D_OVERLAY_BONE_SELECT
@ V3D_ORIENT_NORMAL
@ V3D_ORIENT_CUSTOM
@ V3D_ORIENT_GLOBAL
@ V3D_ORIENT_PARENT
@ V3D_ORIENT_CUSTOM_MATRIX
@ V3D_ORIENT_LOCAL
@ V3D_ORIENT_VIEW
@ V3D_ORIENT_CURSOR
@ V3D_ORIENT_GIMBAL
@ V3D_SHOW_VIEWER
@ V3D_SHOW_CAMERA_PASSEPARTOUT
@ V3D_FLAG2_UNUSED_15
@ V3D_XR_SHOW_CUSTOM_OVERLAYS
@ V3D_SHOW_BUNDLENAME
@ V3D_HIDE_OVERLAYS
@ V3D_FLAG2_UNUSED_14
@ V3D_SHOW_ANNOTATION
@ V3D_SHOW_CAMERAPATH
@ V3D_SHOW_RECONSTRUCTION
@ V3D_RENDER_BORDER
@ V3D_FLAG2_UNUSED_6
@ V3D_FLAG2_UNUSED_10
@ V3D_LOCK_CAMERA
@ V3D_FLAG2_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E_CONTEXT
@ RV3D_NDOF_OFS_IS_VALID
@ RV3D_ZOFFSET_DISABLED
@ RV3D_PAINTING
@ RV3D_CLIPPING
@ RV3D_NAVIGATING
@ RV3D_GPULIGHT_UPDATE
eHandleDisplay
@ CURVE_HANDLE_NONE
@ CURVE_HANDLE_ALL
@ CURVE_HANDLE_SELECTED
eV3DPlaceDepth
@ V3D_PLACE_DEPTH_CURSOR_VIEW
@ V3D_PLACE_DEPTH_CURSOR_PLANE
@ V3D_PLACE_DEPTH_SURFACE
@ V3D_GIZMO_SHOW_ARMATURE_BBONE
@ V3D_GIZMO_SHOW_ARMATURE_ROLL
@ V3D_OVERLAY_EDIT_VERT_NORMALS
@ V3D_OVERLAY_EDIT_INDICES
@ V3D_OVERLAY_EDIT_FREESTYLE_FACE
@ V3D_OVERLAY_EDIT_RETOPOLOGY
@ V3D_OVERLAY_EDIT_LOOP_NORMALS
@ V3D_OVERLAY_EDIT_CU_NORMALS
@ V3D_OVERLAY_EDIT_FACE_NORMALS
@ V3D_OVERLAY_EDIT_CREASES
@ V3D_OVERLAY_EDIT_FREESTYLE_EDGE
@ V3D_OVERLAY_EDIT_EDGES_DEPRECATED
@ V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS
@ V3D_OVERLAY_EDIT_FACES
@ V3D_OVERLAY_EDIT_FACE_AREA
@ V3D_OVERLAY_EDIT_EDGE_ANG
@ V3D_OVERLAY_EDIT_FACE_DOT
@ V3D_OVERLAY_EDIT_FACE_ANG
@ V3D_OVERLAY_EDIT_SEAMS
@ V3D_OVERLAY_EDIT_STATVIS
@ V3D_OVERLAY_EDIT_BWEIGHTS
@ V3D_OVERLAY_EDIT_WEIGHT
@ V3D_OVERLAY_EDIT_SHARP
@ V3D_OVERLAY_EDIT_EDGE_LEN
@ V3D_SHADING_SHADOW
@ V3D_SHADING_SCENE_WORLD_RENDER
@ V3D_SHADING_SPECULAR_HIGHLIGHT
@ V3D_SHADING_DEPTH_OF_FIELD
@ V3D_SHADING_WORLD_ORIENTATION
@ V3D_SHADING_SCENE_WORLD
@ V3D_SHADING_OBJECT_OUTLINE
@ V3D_SHADING_SCENE_LIGHTS
@ V3D_SHADING_CAVITY
@ V3D_SHADING_SCENE_LIGHTS_RENDER
@ V3D_SHADING_STUDIOLIGHT_VIEW_ROTATION
@ V3D_SHADING_MATCAP_FLIP_X
@ V3D_SHADING_XRAY_WIREFRAME
@ V3D_SHADING_XRAY
@ V3D_SHADING_BACKFACE_CULLING
@ V3D_SHOW_FLOOR
@ V3D_SHOW_Z
@ V3D_SHOW_X
@ V3D_SHOW_Y
@ V3D_SHOW_ORTHO_GRID
@ V3D_RUNTIME_LOCAL_MAYBE_EMPTY
@ V3D_RUNTIME_XR_SESSION_ROOT
@ V3D_RUNTIME_DEPTHBUF_OVERRIDDEN
static AppView * view
#define DNA_DEFINE_CXX_METHODS(class_name)
#define T
QuaternionBase< float > Quaternion
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 3 > float3x3
float viewcamtexcofac[4]
float ndof_rot_axis[3]
float viewmatob[4][4]
float tw_axis_matrix[3][3]
float tw_axis_min[3]
struct SmoothView3DStore * sms
float gridview DNA_DEPRECATED
float tw_axis_max[3]
float persmat[4][4]
struct ViewRender * view_render
struct RegionView3D * localvd
float clip[6][4]
float twmat[4][4]
float persinv[4][4]
float viewmat[4][4]
float persmatob[4][4]
float clip_local[6][4]
struct wmTimer * smooth_timer
float viewinv[4][4]
struct BoundBox * clipbb
float winmat[4][4]
float rotation_axis[3]
float rotation_quaternion[4]
float rotation_euler[3]
float gpencil_grid_color[3]
float viewer_attribute_opacity
float normals_constant_screen_size
float sculpt_mode_mask_opacity
float gpencil_grid_scale[2]
float sculpt_mode_face_sets_opacity
float texture_paint_mode_opacity
float gpencil_grid_offset[2]
float sculpt_curves_cage_opacity
float vertex_paint_mode_opacity
float gpencil_vertex_paint_opacity
float weight_paint_mode_opacity
float background_color[3]
float object_outline_color[3]
float curvature_valley_factor
char studio_light[256]
char lookdev_light[256]
struct IDProperty * prop
void(* properties_storage_free)(void *properties_storage)
struct SceneStats * local_stats
char multiview_eye
float vertex_opacity
float bundle_size
View3DOverlay overlay
char gizmo_show_armature
rctf render_border
unsigned short local_collections_uid
char gizmo_show_light
char gizmo_show_camera
View3D_Runtime runtime
float stereo3d_convergence_factor
char _pad3[1]
struct Object * camera
float viewquat[4] DNA_DEPRECATED
char gizmo_show_empty
short gridsubdiv
char stereo3d_camera
char _pad0[6]
struct View3D * localvd
char ob_center_bone[64]
ViewerPath viewer_path
short debug_flag
struct SpaceLink * next
short scenelock
short gridlines
struct SpaceLink * prev
float stereo3d_volume_alpha
int object_type_exclude_select
short ob_center_cursor
char _pad6[2]
struct Object * ob_center
int object_type_exclude_viewport
ListBase regionbase
char _pad[1]
View3DShading shading
char bundle_drawtype
short _pad7[2]
short stereo3d_flag
float stereo3d_convergence_alpha
char gizmo_show_object
unsigned short local_view_uid
float clip_start