diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-01 01:42:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-01 01:42:00 +0300 |
commit | 29937dce8f518b09838f58abcc42a43fb29bf64f (patch) | |
tree | 256469286467ecf55abbea85a7a5a10035da3108 /source | |
parent | 7b72be0134887622518f1fb6d6009fa67bf41593 (diff) | |
parent | e8d58080df07d4b7d9372bfca0dd54ea2817394a (diff) |
Merge branch 'master' into blender2.8
Move 'View3D.flag3' options into 'gp_flag'.
Diffstat (limited to 'source')
7 files changed, 31 insertions, 33 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index d2a1cc1f4f1..ab787a52cfd 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -1645,9 +1645,6 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; - v3d->shading.background_type = ( - (v3d->flag3 & V3D_SHOW_WORLD) ? - V3D_SHADING_BACKGROUND_WORLD : V3D_SHADING_BACKGROUND_THEME); copy_v3_fl(v3d->shading.background_color, 0.05f); } } @@ -1743,7 +1740,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; v3d->vertex_opacity = 1.0f; - v3d->flag3 |= V3D_GP_SHOW_EDIT_LINES; + v3d->gp_flag |= V3D_GP_SHOW_EDIT_LINES; } } } diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index da3787816d2..c120eed695c 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -449,9 +449,9 @@ void BLO_update_defaults_startup_blend(Main *bmain) for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; - v3d->flag3 |= V3D_GP_SHOW_EDIT_LINES; - v3d->flag3 |= V3D_GP_SHOW_MULTIEDIT_LINES; - v3d->flag3 |= V3D_GP_SHOW_ONION_SKIN; + v3d->gp_flag |= V3D_GP_SHOW_EDIT_LINES; + v3d->gp_flag |= V3D_GP_SHOW_MULTIEDIT_LINES; + v3d->gp_flag |= V3D_GP_SHOW_ONION_SKIN; v3d->vertex_opacity = 0.9f; break; } diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 04399d1cad7..4d2942e08fd 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -658,7 +658,7 @@ static void gpencil_add_editpoints_shgroup( if (cache->batch_edlin[cache->cache_idx]) { if ((obact) && (obact == ob) && ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_EDIT_LINES)) + (v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES)) { DRW_shgroup_call_add( stl->g_data->shgrps_edit_line, @@ -757,7 +757,7 @@ static void gpencil_draw_strokes( const bool playing = (bool)stl->storage->playing; const bool is_render = (bool)stl->storage->is_render; const bool is_mat_preview = (bool)stl->storage->is_mat_preview; - const bool overlay_multiedit = v3d != NULL ? (v3d->flag3 & V3D_GP_SHOW_MULTIEDIT_LINES) : true; + const bool overlay_multiedit = v3d != NULL ? (v3d->gp_flag & V3D_GP_SHOW_MULTIEDIT_LINES) : true; /* Get evaluation context */ /* NOTE: We must check if C is valid, otherwise we get crashes when trying to save files @@ -1182,7 +1182,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph); ToolSettings *ts = scene->toolsettings; bGPDframe *derived_gpf = NULL; - const bool main_onion = v3d != NULL ? ((v3d->flag3 & V3D_GP_SHOW_ONION_SKIN) == 0) : true; + const bool main_onion = v3d != NULL ? ((v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) == 0) : true; const bool no_onion = (bool)(gpd->flag & GP_DATA_STROKE_WEIGHTMODE) || main_onion; const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) : true; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 0c76971ac4b..8b8da3f2065 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -510,7 +510,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) /* grid */ if ((v3d) && ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID) && + (v3d->gp_flag & V3D_GP_SHOW_GRID) && (ob->type == OB_GPENCIL) && (ob == draw_ctx->obact)) { stl->g_data->batch_grid = DRW_gpencil_get_grid(); @@ -640,7 +640,7 @@ void GPENCIL_draw_scene(void *ved) /* paper pass to display a confortable area to draw over complex scenes with geometry */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_PAPER) && + (v3d->gp_flag & V3D_GP_SHOW_PAPER) && (stl->g_data->gp_cache_used > 0)) { DRW_draw_pass(psl->paper_pass); @@ -664,7 +664,7 @@ void GPENCIL_draw_scene(void *ved) /* grid pass */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID)) + (v3d->gp_flag & V3D_GP_SHOW_GRID)) { DRW_draw_pass(psl->grid_pass); } @@ -753,7 +753,7 @@ void GPENCIL_draw_scene(void *ved) /* grid pass */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID)) + (v3d->gp_flag & V3D_GP_SHOW_GRID)) { DRW_draw_pass(psl->grid_pass); } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index c1776ef18e7..eaa6f03c533 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -359,7 +359,7 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene) /* grease pencil settings */ v3d->vertex_opacity = 1.0f; - v3d->flag3 |= V3D_GP_SHOW_EDIT_LINES; + v3d->gp_flag |= V3D_GP_SHOW_EDIT_LINES; /* header */ ar = MEM_callocN(sizeof(ARegion), "header for view3d"); diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 27b07a317ed..317cde9009d 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -236,8 +236,10 @@ typedef struct View3D { int layact; short ob_centre_cursor; /* optional bool for 3d cursor to define center */ - short scenelock, _pad1; - short flag, flag2, pad2; + short scenelock; + short gp_flag; + short flag; + int flag2; float lens, grid; float near, far; @@ -256,16 +258,16 @@ typedef struct View3D { /* transform gizmo info */ char _pad5[2], gizmo_flag; - short flag3; + short _pad2; /* drawflags, denoting state */ - char _pad2; + char _pad3; char transp, xray; char multiview_eye; /* multiview current eye - for internal use */ /* actually only used to define the opacity of the grease pencil vertex in edit mode */ - float vertex_opacity; + float vertex_opacity; /* note, 'fx_settings.dof' is currently _not_ allocated, * instead set (temporarily) from camera */ @@ -346,7 +348,7 @@ typedef struct View3D { #define RV3D_VIEW_IS_AXIS(view) \ (((view) >= RV3D_VIEW_FRONT) && ((view) <= RV3D_VIEW_BOTTOM)) -/* View3d->flag2 (short) */ +/* View3d->flag2 (int) */ #define V3D_RENDER_OVERRIDE (1 << 2) #define V3D_SOLID_TEX (1 << 3) #define V3D_SHOW_ANNOTATION (1 << 4) @@ -362,13 +364,12 @@ typedef struct View3D { #define V3D_OCCLUDE_WIRE (1 << 14) #define V3D_SHOW_MODE_SHADE_OVERRIDE (1 << 15) /* XXX: DNA deprecated */ -/* View3d->flag3 (short) */ -#define V3D_SHOW_WORLD (1 << 0) /* LEGACY replaced by V3D_SHADING_BACKGROUND_WORLD */ -#define V3D_GP_SHOW_PAPER (1 << 2) /* Activate paper to cover all viewport */ -#define V3D_GP_SHOW_GRID (1 << 3) /* Activate paper grid */ -#define V3D_GP_SHOW_EDIT_LINES (1 << 4) -#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 5) -#define V3D_GP_SHOW_ONION_SKIN (1 << 6) /* main switch at view level */ +/* View3d->gp_flag (short) */ +#define V3D_GP_SHOW_PAPER (1 << 0) /* Activate paper to cover all viewport */ +#define V3D_GP_SHOW_GRID (1 << 1) /* Activate paper grid */ +#define V3D_GP_SHOW_EDIT_LINES (1 << 2) +#define V3D_GP_SHOW_MULTIEDIT_LINES (1 << 3) +#define V3D_GP_SHOW_ONION_SKIN (1 << 4) /* main switch at view level */ /* View3DShading->light */ enum { diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ab662e71380..d7563f13dc2 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2865,13 +2865,13 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "use_gpencil_paper", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_PAPER); + RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_PAPER); RNA_def_property_ui_text(prop, "Use Paper", "Cover all viewport with a full color layer to improve visibility while drawing over complex scenes"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "use_gpencil_grid", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_GRID); + RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_GRID); RNA_def_property_ui_text(prop, "Use Grid", "Draw a grid over grease pencil paper"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); @@ -2913,18 +2913,18 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna) /* show edit lines */ prop = RNA_def_property(srna, "use_gpencil_edit_lines", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_EDIT_LINES); + RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_EDIT_LINES); RNA_def_property_ui_text(prop, "Edit Lines", "Show edit lines when edit strokes"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); prop = RNA_def_property(srna, "use_gpencil_multiedit_line_only", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_MULTIEDIT_LINES); + RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_MULTIEDIT_LINES); RNA_def_property_ui_text(prop, "Lines Only", "Show only edit lines for additional frames"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); /* main grease pencil onion switch */ prop = RNA_def_property(srna, "use_gpencil_onion_skin", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag3", V3D_GP_SHOW_ONION_SKIN); + RNA_def_property_boolean_sdna(prop, NULL, "gp_flag", V3D_GP_SHOW_ONION_SKIN); RNA_def_property_ui_text(prop, "Onion Skins", "Show ghosts of the frames before and after the current frame"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_GPencil_update"); |