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:
authorJeroen Bakker <j.bakker@atmind.nl>2018-05-03 11:55:28 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2018-05-03 11:55:28 +0300
commit026792ffed8ad7fb27ef877af75a06136d13a438 (patch)
treec0e10bd8bc860f8c3d54fd085df70e63f6658d5c
parentd64f12248abae3d9773bdb7c21a5c7b7e4471cc5 (diff)
Workbench: Show 3D Cursor Overlay
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py7
-rw-r--r--source/blender/blenloader/intern/versioning_280.c4
-rw-r--r--source/blender/draw/intern/draw_view.c4
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c1
-rw-r--r--source/blender/makesdna/DNA_view3d_types.h1
-rw-r--r--source/blender/makesrna/intern/rna_space.c5
6 files changed, 20 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 2fa4061faaf..077af19da8c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3594,13 +3594,17 @@ class VIEW3D_PT_overlay(Panel):
overlay = view.overlay
shading = view.shading
scene = context.scene
+ display_all = overlay.show_overlays
col = layout.column()
col.prop(overlay, "show_overlays")
col.separator()
-
col.prop(view, "show_world")
+ col = layout.column()
+ col.active = display_all
+ col.prop(overlay, "show_3dcursor")
+
if context.mode in {'PAINT_WEIGHT', 'PAINT_VERTEX'}:
engine_type = {
'PAINT_WEIGHT': 'WeightPaintMode',
@@ -3613,7 +3617,6 @@ class VIEW3D_PT_overlay(Panel):
col.prop(view, "show_mode_shade_override")
col = layout.column()
- display_all = overlay.show_overlays
col.active = display_all
col.prop(view, "show_outline_selected")
col.prop(view, "show_all_objects_origin")
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 07f51dfbc2f..c9619137b9a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1068,6 +1068,10 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
}
}
}
+ if (sl->spacetype == SPACE_VIEW3D) {
+ View3D *v3d = (View3D *)sl;
+ v3d->overlays |= V3D_OVERLAY_3DCURSOR;
+ }
}
}
}
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index 42a81cd9839..5a0c5d1f35c 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -614,6 +614,10 @@ void DRW_draw_background(void)
static bool is_cursor_visible(const DRWContextState *draw_ctx, Scene *scene, ViewLayer *view_layer)
{
Object *ob = OBACT(view_layer);
+ View3D *v3d = draw_ctx->v3d;
+ if ((v3d->flag2 & V3D_RENDER_OVERRIDE) > 0 || (v3d->overlays & V3D_OVERLAY_3DCURSOR) == 0) {
+ return false;
+ }
/* don't draw cursor in paint modes, but with a few exceptions */
if (ob && draw_ctx->object_mode & OB_MODE_ALL_PAINT) {
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index c95ed974843..086efbe9c34 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -323,6 +323,7 @@ static SpaceLink *view3d_new(const ScrArea *UNUSED(sa), const Scene *scene)
v3d->gridsubdiv = 10;
v3d->drawtype = OB_SOLID;
v3d->drawtype_lighting = V3D_LIGHTING_STUDIO;
+ v3d->overlays = V3D_OVERLAY_3DCURSOR;
v3d->gridflag = V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_FLOOR;
diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h
index 0644837727e..545acf667b6 100644
--- a/source/blender/makesdna/DNA_view3d_types.h
+++ b/source/blender/makesdna/DNA_view3d_types.h
@@ -95,6 +95,7 @@ enum {
enum {
V3D_OVERLAY_FACE_ORIENTATION = (1 << 0),
+ V3D_OVERLAY_3DCURSOR = (1 << 1),
};
typedef struct RegionView3D {
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 30c00b93867..8cef700e934 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2252,6 +2252,11 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag2", V3D_RENDER_OVERRIDE);
RNA_def_property_ui_text(prop, "Show Overlays", "Display overlays like manipulators and outlines");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "show_3dcursor", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "overlays", V3D_OVERLAY_3DCURSOR);
+ RNA_def_property_ui_text(prop, "Show 3D Cursor", "Display 3D Cursor Overlay");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
static void rna_def_space_view3d(BlenderRNA *brna)