Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesdna/DNA_view3d_types.h')
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h241
1 files changed, 149 insertions, 92 deletions
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index b90c35e7473..c3e0fe38296 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -44,7 +44,7 @@ struct bGPdata;
struct SmoothView3DStore;
struct wmTimer;
struct Material;
-struct GPUFX;
+struct GPUViewport;
#include "DNA_defs.h"
#include "DNA_listBase.h"
@@ -61,23 +61,6 @@ struct GPUFX;
# undef far
#endif
-/* Background Picture in 3D-View */
-typedef struct BGpic {
- struct BGpic *next, *prev;
-
- struct Image *ima;
- struct ImageUser iuser;
- struct MovieClip *clip;
- struct MovieClipUser cuser;
- float xof, yof, size, blend, rotation;
- short view;
- short flag;
- short source;
- char pad[6];
-} BGpic;
-
-/* ********************************* */
-
typedef struct RegionView3D {
float winmat[4][4]; /* GL_PROJECTION matrix */
@@ -106,8 +89,13 @@ typedef struct RegionView3D {
struct wmTimer *smooth_timer;
- /* transform widget matrix */
+ /* transform manipulator matrix */
float twmat[4][4];
+ /* min/max dot product on twmat xyz axis. */
+ float tw_axis_min[3], tw_axis_max[3];
+ float tw_axis_matrix[3][3];
+
+ float gridview;
float viewquat[4]; /* view rotation, must be kept normalized */
float dist; /* distance from 'ofs' along -viewinv[2] vector, where result is negative as is 'ofs' */
@@ -125,7 +113,7 @@ typedef struct RegionView3D {
char pad[3];
float ofs_lock[2]; /* normalized offset for locked view: (-1, -1) bottom left, (1, 1) upper right */
- short twdrawflag;
+ short twdrawflag; /* XXX can easily get rid of this (Julian) */
short rflag;
@@ -133,17 +121,67 @@ typedef struct RegionView3D {
float lviewquat[4];
short lpersp, lview; /* lpersp can never be set to 'RV3D_CAMOB' */
- float gridview;
- float tw_idot[3]; /* manipulator runtime: (1 - dot) product with view vector (used to check view alignment) */
-
-
/* active rotation from NDOF or elsewhere */
float rot_angle;
float rot_axis[3];
-
- struct GPUFX *compositor;
} RegionView3D;
+typedef struct View3DCursor {
+ float location[3];
+ float rotation[4];
+ char _pad[4];
+} View3DCursor;
+
+/* 3D Viewport Shading setings */
+typedef struct View3DShading {
+ short flag;
+ short color_type;
+
+ short light;
+ char pad[2];
+ char studio_light[256]; /* FILE_MAXFILE */
+ char matcap[256]; /* FILE_MAXFILE */
+
+ float shadow_intensity;
+ float single_color[3];
+
+ float studiolight_rot_z;
+ float studiolight_background;
+
+ float object_outline_color[3];
+ float xray_alpha;
+
+ float cavity_valley_factor;
+ float cavity_ridge_factor;
+} View3DShading;
+
+/* 3D Viewport Overlay setings */
+typedef struct View3DOverlay {
+ int flag;
+
+ /* Edit mode settings */
+ int edit_flag;
+ float normals_length;
+ float backwire_opacity;
+
+ /* Paint mode settings */
+ int paint_flag;
+
+ /* Alpha for texture, weight, vertex paint overlay */
+ float texture_paint_mode_opacity;
+ float vertex_paint_mode_opacity;
+ float weight_paint_mode_opacity;
+
+ /* Armature edit/pose mode settings */
+ int arm_flag;
+ float bone_selection_alpha;
+
+ /* Other settings */
+ float wireframe_threshold;
+
+ int pad;
+} View3DOverlay;
+
/* 3D ViewPort Struct */
typedef struct View3D {
struct SpaceLink *next, *prev;
@@ -169,9 +207,6 @@ typedef struct View3D {
struct Object *camera, *ob_centre;
rctf render_border;
- struct ListBase bgpicbase;
- struct BGpic *bgpic DNA_DEPRECATED; /* deprecated, use bgpicbase, only kept for do_versions(...) */
-
struct View3D *localvd; /* allocated backup of its self while in localview */
char ob_centre_bone[64]; /* optional string for armature bone to define center, MAXBONENAME */
@@ -179,18 +214,17 @@ typedef struct View3D {
unsigned int lay;
int layact;
- /**
- * The drawing mode for the 3d display. Set to OB_BOUNDBOX, OB_WIRE, OB_SOLID,
- * OB_TEXTURE, OB_MATERIAL or OB_RENDER */
- short drawtype;
short ob_centre_cursor; /* optional bool for 3d cursor to define center */
- short scenelock, around;
- short flag, flag2;
+ short scenelock, _pad1;
+ short flag, flag2, pad2;
float lens, grid;
float near, far;
float ofs[3] DNA_DEPRECATED; /* XXX deprecated */
- float cursor[3];
+
+ View3DCursor cursor;
+
+ char _pad[4];
short matcap_icon; /* icon id */
@@ -198,22 +232,16 @@ typedef struct View3D {
short gridsubdiv; /* Number of subdivisions in the grid between each highlighted grid line */
char gridflag;
- /* transform widget info */
- char twtype, twmode, twflag;
+ /* transform manipulator info */
+ char twtype, _pad5, twflag;
short flag3;
- /* afterdraw, for xray & transparent */
- struct ListBase afterdraw_transp;
- struct ListBase afterdraw_xray;
- struct ListBase afterdraw_xraytransp;
-
/* drawflags, denoting state */
char zbuf, transp, xray;
char multiview_eye; /* multiview current eye - for internal use */
- /* built-in shader effects (eGPUFXFlags) */
char pad3[4];
/* note, 'fx_settings.dof' is currently _not_ allocated,
@@ -221,13 +249,11 @@ typedef struct View3D {
struct GPUFXSettings fx_settings;
void *properties_storage; /* Nkey panel stores stuff here (runtime only!) */
- /* Allocated per view, not library data (used by matcap). */
- struct Material *defmaterial;
/* XXX deprecated? */
struct bGPdata *gpd DNA_DEPRECATED; /* Grease-Pencil Data (annotation layers) */
- /* multiview - stereo 3d */
+ /* Stereoscopy settings */
short stereo3d_flag;
char stereo3d_camera;
char pad4;
@@ -235,12 +261,13 @@ typedef struct View3D {
float stereo3d_volume_alpha;
float stereo3d_convergence_alpha;
- /* Previous viewport draw type.
- * Runtime-only, set in the rendered viewport toggle operator.
- */
- short prev_drawtype;
- short pad1;
- float pad2;
+ /* Display settings */
+ short drawtype; /* Shading mode (OB_SOLID, OB_TEXTURE, ..) */
+ short prev_drawtype; /* Runtime, for toggle between rendered viewport. */
+ int pad5;
+
+ View3DShading shading;
+ View3DOverlay overlay;
} View3D;
@@ -250,12 +277,12 @@ typedef struct View3D {
#define V3D_S3D_DISPVOLUME (1 << 2)
/* View3D->flag (short) */
-/*#define V3D_DISPIMAGE 1*/ /*UNUSED*/
-#define V3D_DISPBGPICS 2
+/*#define V3D_FLAG_DEPRECATED_1 (1 << 0) */ /*UNUSED */
+/*#define V3D_FLAG_DEPRECATED_2 (1 << 1) */ /* UNUSED */
#define V3D_HIDE_HELPLINES 4
#define V3D_INVALID_BACKBUF 8
-#define V3D_ALIGN 1024
+/* #define V3D_FLAG_DEPRECATED_10 (1 << 10) */ /* UNUSED */
#define V3D_SELECT_OUTLINE 2048
#define V3D_ZBUF_SELECT 4096
#define V3D_GLOBAL_STATS 8192
@@ -270,7 +297,7 @@ typedef struct View3D {
#define RV3D_CLIPPING 4
#define RV3D_NAVIGATING 8
#define RV3D_GPULIGHT_UPDATE 16
-#define RV3D_IS_GAME_ENGINE 32 /* runtime flag, used to check if LoD's should be used */
+/*#define RV3D_IS_GAME_ENGINE 32 *//* UNUSED */
/**
* Disable zbuffer offset, skip calls to #ED_view3d_polygon_offset.
* Use when precise surface depth is needed and picking bias isn't, see T45434).
@@ -311,12 +338,71 @@ typedef struct View3D {
#define V3D_SOLID_MATCAP (1 << 12) /* user flag */
#define V3D_SHOW_SOLID_MATCAP (1 << 13) /* runtime flag */
#define V3D_OCCLUDE_WIRE (1 << 14)
-#define V3D_SHADELESS_TEX (1 << 15)
+#define V3D_SHOW_MODE_SHADE_OVERRIDE (1 << 15) /* XXX: DNA deprecated */
/* View3d->flag3 (short) */
#define V3D_SHOW_WORLD (1 << 0)
+/* View3DShading->light */
+enum {
+ V3D_LIGHTING_FLAT = 0,
+ V3D_LIGHTING_STUDIO = 1,
+ V3D_LIGHTING_MATCAP = 2,
+};
+
+/* View3DShading->flag */
+enum {
+ V3D_SHADING_OBJECT_OUTLINE = (1 << 0),
+ V3D_SHADING_XRAY = (1 << 1),
+ V3D_SHADING_SHADOW = (1 << 2),
+ V3D_SHADING_SCENE_LIGHT = (1 << 3),
+ V3D_SHADING_SPECULAR_HIGHLIGHT = (1 << 4),
+ V3D_SHADING_CAVITY = (1 << 5),
+ V3D_SHADING_MATCAP_FLIP_X = (1 << 6),
+};
+
+/* View3DShading->color_type */
+enum {
+ V3D_SHADING_MATERIAL_COLOR = 0,
+ V3D_SHADING_RANDOM_COLOR = 1,
+ V3D_SHADING_SINGLE_COLOR = 2,
+ V3D_SHADING_TEXTURE_COLOR = 3,
+};
+
+/* View3DOverlay->flag */
+enum {
+ V3D_OVERLAY_FACE_ORIENTATION = (1 << 0),
+ V3D_OVERLAY_HIDE_CURSOR = (1 << 1),
+ V3D_OVERLAY_BONE_SELECTION = (1 << 2),
+ V3D_OVERLAY_LOOK_DEV = (1 << 3),
+ V3D_OVERLAY_WIREFRAMES = (1 << 4),
+ V3D_OVERLAY_HIDE_TEXT = (1 << 5),
+ V3D_OVERLAY_HIDE_MOTION_PATHS = (1 << 6),
+ V3D_OVERLAY_ONION_SKINS = (1 << 7),
+};
+
+/* View3DOverlay->edit_flag */
+enum {
+ V3D_OVERLAY_EDIT_VERT_NORMALS = (1 << 0),
+ V3D_OVERLAY_EDIT_LOOP_NORMALS = (1 << 1),
+ V3D_OVERLAY_EDIT_FACE_NORMALS = (1 << 2),
+
+ V3D_OVERLAY_EDIT_OCCLUDE_WIRE = (1 << 3),
+
+ V3D_OVERLAY_EDIT_WEIGHT = (1 << 4),
+};
+
+/* View3DOverlay->arm_flag */
+enum {
+ V3D_OVERLAY_ARM_TRANSP_BONES = (1 << 0),
+};
+
+/* View3DOverlay->paint_flag */
+enum {
+ V3D_OVERLAY_PAINT_WIRE = (1 << 0),
+};
+
/* View3D->around */
enum {
/* center of the bounding box */
@@ -347,49 +433,20 @@ enum {
#define V3D_SHOW_Y 4
#define V3D_SHOW_Z 8
-/* View3d->twtype (bits, we can combine them) */
-#define V3D_MANIP_TRANSLATE 1
-#define V3D_MANIP_ROTATE 2
-#define V3D_MANIP_SCALE 4
-
-/* View3d->twmode */
+/* Scene.orientation_type */
#define V3D_MANIP_GLOBAL 0
#define V3D_MANIP_LOCAL 1
#define V3D_MANIP_NORMAL 2
#define V3D_MANIP_VIEW 3
#define V3D_MANIP_GIMBAL 4
-#define V3D_MANIP_CUSTOM 5 /* anything of value 5 or higher is custom */
+#define V3D_MANIP_CURSOR 5
+#define V3D_MANIP_CUSTOM 1024
-/* View3d->twflag */
- /* USE = user setting, DRAW = based on selection */
-#define V3D_USE_MANIPULATOR 1
-#define V3D_DRAW_MANIPULATOR 2
-/* #define V3D_CALC_MANIPULATOR 4 */ /*UNUSED*/
-
-/* BGPic->flag */
-/* may want to use 1 for select ? */
+/* View3d->twflag (also) */
enum {
- V3D_BGPIC_EXPANDED = (1 << 1),
- V3D_BGPIC_CAMERACLIP = (1 << 2),
- V3D_BGPIC_DISABLED = (1 << 3),
- V3D_BGPIC_FOREGROUND = (1 << 4),
-
- /* Camera framing options */
- V3D_BGPIC_CAMERA_ASPECT = (1 << 5), /* don't stretch to fit the camera view */
- V3D_BGPIC_CAMERA_CROP = (1 << 6), /* crop out the image */
-
- /* Axis flip options */
- V3D_BGPIC_FLIP_X = (1 << 7),
- V3D_BGPIC_FLIP_Y = (1 << 8),
+ V3D_MANIPULATOR_DRAW = (1 << 0),
};
-#define V3D_BGPIC_EXPANDED (V3D_BGPIC_EXPANDED | V3D_BGPIC_CAMERACLIP)
-
-/* BGPic->source */
-/* may want to use 1 for select ?*/
-#define V3D_BGPIC_IMAGE 0
-#define V3D_BGPIC_MOVIE 1
-
#define RV3D_CAMZOOM_MIN -30
#define RV3D_CAMZOOM_MAX 600