Blender V5.0
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
289
290 /* Only used for overlay stats while in local-view. */
293
295typedef struct View3D {
297
298 struct SpaceLink *next, *prev;
303 char _pad0[6];
304 /* End 'SpaceLink' header. */
305
306 float viewquat[4] DNA_DEPRECATED;
307 float dist DNA_DEPRECATED;
308
313
314 char drawtype DNA_DEPRECATED;
315
316 char _pad3[1];
317
320
323
324 short persp DNA_DEPRECATED;
326
329
332
334 char ob_center_bone[/*MAXBONENAME*/ 64];
335
336 unsigned short local_view_uid;
337 char _pad6[2];
338 int layact DNA_DEPRECATED;
339 unsigned short local_collections_uid;
340 short _pad7[2];
341
343
347 short gp_flag;
348 short flag;
349 int flag2;
350
351 float lens, grid;
354 float ofs[2] DNA_DEPRECATED;
355
356 char _pad[1];
357
361
367
369
373
376
377 /* XXX deprecated? */
380
384 char _pad4;
388
392
395
399
401enum {
405};
406
408enum {
410 V3D_FLAG_UNUSED_1 = 1 << 1, /* cleared */
412 V3D_FLAG_UNUSED_2 = 1 << 3, /* cleared */
415
416 V3D_FLAG_UNUSED_10 = 1 << 10, /* cleared */
418 V3D_FLAG_UNUSED_12 = 1 << 12, /* cleared */
421};
422
424enum {
433
434};
435
437enum {
441};
442
444enum {
455};
456
458enum {
466 RV3D_BOXVIEW = (1 << 1),
467 RV3D_BOXCLIP = (1 << 2),
470
472};
473
475#define RV3D_LOCK_FLAGS(rv3d) ((rv3d)->viewlock | ((rv3d)->runtime_viewlock))
476
478enum {
480};
481
483enum {
492};
493
494#define RV3D_VIEW_IS_AXIS(view) (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM))
495
501enum {
506};
507
509enum {
525};
526
527#define RV3D_CLIPPING_ENABLED(v3d, rv3d) \
528 ((rv3d) && (v3d) && ((rv3d)->rflag & RV3D_CLIPPING) && \
529 ELEM((v3d)->shading.type, OB_WIRE, OB_SOLID) && (rv3d)->clipbb)
530
532enum {
537 V3D_FLAG2_UNUSED_6 = 1 << 6, /* cleared */
541 V3D_FLAG2_UNUSED_10 = 1 << 10, /* cleared */
543 V3D_FLAG2_UNUSED_12 = 1 << 12, /* cleared */
544 V3D_FLAG2_UNUSED_13 = 1 << 13, /* cleared */
545 V3D_FLAG2_UNUSED_14 = 1 << 14, /* cleared */
546 V3D_FLAG2_UNUSED_15 = 1 << 15, /* cleared */
552};
553
555enum {
578};
579
581enum {
597};
598
600enum {
602};
603
604#define V3D_USES_SCENE_LIGHTS(v3d) \
605 ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS)) || \
606 (((v3d)->shading.type == OB_RENDER) && \
607 ((v3d)->shading.flag & V3D_SHADING_SCENE_LIGHTS_RENDER)))
608
609#define V3D_USES_SCENE_WORLD(v3d) \
610 ((((v3d)->shading.type == OB_MATERIAL) && ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD)) || \
611 (((v3d)->shading.type == OB_RENDER) && \
612 ((v3d)->shading.flag & V3D_SHADING_SCENE_WORLD_RENDER)))
613
615enum {
619};
620
629
631enum {
643 V3D_OVERLAY_STATS = (1 << 11),
651};
652
654enum {
658
660
662
666
671
674
681
682 /* Deprecated. */
683 // V3D_OVERLAY_EDIT_CU_HANDLES = (1 << 20),
684
687};
688
690enum {
692};
693
695enum {
697};
698
700enum {
701 /* center of the bounding box */
703 /* center from the sum of all points divided by the total */
705 /* pivot around the 2D/3D cursor */
707 /* pivot around each items own origin */
709 /* pivot around the active items origin */
711};
712
714enum {
716 V3D_SHOW_X = 1 << 1,
717 V3D_SHOW_Y = 1 << 2,
718 V3D_SHOW_Z = 1 << 3,
720};
721
723enum {
734};
735
737enum {
739 V3D_GIZMO_HIDE = (1 << 0),
744};
745
747enum {
751};
753enum {
758};
760enum {
763};
765enum {
769};
771enum {
775};
776
783
788
789#define RV3D_CAMZOOM_MIN -30
790#define RV3D_CAMZOOM_MAX 600
791
793#define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f
794#define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:66
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_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_UNUSED_12
@ V3D_SHOW_CAMERA_GUIDES
@ V3D_XR_SHOW_PASSTHROUGH
@ V3D_XR_SHOW_CONTROLLERS
@ V3D_FLAG2_UNUSED_13
@ 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_GIZMO_HIDE_TOOL
@ V3D_GIZMO_HIDE_MODIFIER
@ V3D_GIZMO_HIDE
@ V3D_GIZMO_HIDE_NAVIGATE
@ V3D_GIZMO_HIDE_CONTEXT
@ RV3D_VIEW_AXIS_ROLL_270
@ RV3D_VIEW_AXIS_ROLL_180
@ RV3D_VIEW_AXIS_ROLL_90
@ RV3D_VIEW_AXIS_ROLL_0
@ RV3D_VIEW_FRONT
@ RV3D_VIEW_BOTTOM
@ RV3D_VIEW_LEFT
@ RV3D_VIEW_CAMERA
@ RV3D_VIEW_RIGHT
@ RV3D_VIEW_TOP
@ RV3D_VIEW_BACK
@ RV3D_VIEW_USER
@ V3D_GP_FORCE_STROKE_ORDER_3D
@ V3D_GP_SHOW_MATERIAL_NAME
@ V3D_GP_FADE_OBJECTS
@ V3D_GP_SHOW_MULTIEDIT_LINES
@ V3D_GP_ONION_SKIN_ACTIVE_OBJECT
@ V3D_GP_SHOW_GRID_XRAY
@ V3D_GP_SHOW_STROKE_DIRECTION
@ V3D_GP_FADE_NOACTIVE_GPENCIL
@ V3D_GP_SHOW_EDIT_LINES
@ V3D_GP_SHOW_GRID
@ V3D_GP_FADE_NOACTIVE_LAYERS
@ V3D_GP_SHOW_ONION_SKIN
@ V3D_SHADING_CAVITY_BOTH
@ V3D_SHADING_CAVITY_SSAO
@ V3D_SHADING_CAVITY_CURVATURE
@ V3D_DEBUG_FREEZE_CULLING
@ RV3D_ZOFFSET_DISABLED
@ RV3D_PAINTING
@ RV3D_WAS_CAMOB
@ RV3D_CLIPPING
@ RV3D_NAVIGATING
@ RV3D_GPULIGHT_UPDATE
@ V3D_GIZMO_SHOW_OBJECT_ROTATE
@ V3D_GIZMO_SHOW_OBJECT_SCALE
@ V3D_GIZMO_SHOW_OBJECT_TRANSLATE
@ V3D_AROUND_ACTIVE
@ V3D_AROUND_CENTER_BOUNDS
@ V3D_AROUND_CURSOR
@ V3D_AROUND_CENTER_MEDIAN
@ V3D_AROUND_LOCAL_ORIGINS
@ V3D_GIZMO_SHOW_ARMATURE_BBONE
@ V3D_GIZMO_SHOW_ARMATURE_ROLL
@ V3D_RUNTIME_LOCAL_MAYBE_EMPTY
@ V3D_RUNTIME_XR_SESSION_ROOT
@ V3D_RUNTIME_DEPTHBUF_OVERRIDDEN
@ V3D_RUNTIME_OFS_LAST_CENTER_IS_VALID
@ 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_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_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3D_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_S3D_DISPCAMERAS
@ V3D_S3D_DISPPLANE
@ V3D_S3D_DISPVOLUME
@ V3D_GIZMO_SHOW_LIGHT_LOOK_AT
@ V3D_GIZMO_SHOW_LIGHT_SIZE
static AppView * view
#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
float vignette_aperture
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