[Bf-blender-cvs] [c17611af951] blender2.8: Manipulator: changes for overlay options
Campbell Barton
noreply at git.blender.org
Wed Jul 11 10:49:24 CEST 2018
Commit: c17611af951e46fb82bf43d7449240f2f829b78f
Author: Campbell Barton
Date: Wed Jul 11 10:38:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc17611af951e46fb82bf43d7449240f2f829b78f
Manipulator: changes for overlay options
There are now 3 categories in the overlay popover:
- Navigation
- Active (camera, lamp... etc)
- Tool (manipulator)
The user preference for mini axis now controls if the mini axis
displays minimal or a full-interactive widget.
Part of design: T55863
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/blenloader/intern/versioning_defaults.c
M source/blender/draw/intern/draw_manager.c
M source/blender/editors/interface/resources.c
M source/blender/editors/manipulator_library/manipulator_draw_utils.c
M source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
M source/blender/editors/mesh/editmesh_add_manipulator.c
M source/blender/editors/mesh/editmesh_bevel.c
M source/blender/editors/mesh/editmesh_bisect.c
M source/blender/editors/mesh/editmesh_extrude_spin.c
M source/blender/editors/mesh/editmesh_inset.c
M source/blender/editors/space_view3d/space_view3d.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/editors/space_view3d/view3d_manipulator_armature.c
M source/blender/editors/space_view3d/view3d_manipulator_camera.c
M source/blender/editors/space_view3d/view3d_manipulator_empty.c
M source/blender/editors/space_view3d/view3d_manipulator_forcefield.c
M source/blender/editors/space_view3d/view3d_manipulator_lamp.c
M source/blender/editors/space_view3d/view3d_manipulator_navigate.c
M source/blender/editors/space_view3d/view3d_ops.c
M source/blender/editors/transform/transform.h
M source/blender/editors/transform/transform_generics.c
M source/blender/editors/transform/transform_manipulator_3d.c
M source/blender/makesdna/DNA_userdef_types.h
M source/blender/makesdna/DNA_view3d_types.h
M source/blender/makesrna/intern/rna_space.c
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index e44fd6e09db..ca96c79b2b4 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -238,15 +238,15 @@ class USERPREF_PT_interface(Panel):
col.separator()
- col.prop(view, "show_manipulator_navigate")
+ # col.prop(view, "show_manipulator_navigate")
sub = col.column(align=True)
- sub.prop(view, "show_mini_axis", text="Display Mini Axis")
- sub.active = not view.show_manipulator_navigate
+ sub.label("3D Viewport Axis:")
+ sub.row().prop(view, "mini_axis_type", expand=True)
sub = col.column(align=True)
- sub.active = view.show_mini_axis
+ sub.active = view.mini_axis_type == 'MINIMAL'
sub.prop(view, "mini_axis_size", text="Size")
sub.prop(view, "mini_axis_brightness", text="Brightness")
@@ -258,9 +258,7 @@ class USERPREF_PT_interface(Panel):
#col.label(text="Open Toolbox Delay:")
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
- col.prop(view, "show_manipulator", text="Transform Manipulator")
- # Currently not working
- # col.prop(view, "show_manipulator_shaded")
+ col.prop(view, "show_manipulator", text="Manipulators")
sub = col.column()
sub.active = view.show_manipulator
sub.prop(view, "manipulator_size", text="Size")
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index b484bf08c3b..3e97877c115 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3882,6 +3882,20 @@ class VIEW3D_PT_overlay(Panel):
sub = split.column()
sub.prop(view, "show_manipulator", text="Manipulators")
+ has_manipulator = view.show_manipulator
+ subsub = sub.column()
+ subsub.active = has_manipulator
+ subsub.prop(view, "show_manipulator_navigate", text="Navigate")
+ del subsub
+ sub = split.column()
+ sub.active = has_manipulator
+ sub.prop(view, "show_manipulator_context", text="Active Object")
+ sub.prop(view, "show_manipulator_tool", text="Active Tools")
+
+ col.separator()
+
+ split = col.split()
+ sub = split.column()
sub.prop(overlay, "show_text", text="Text")
sub.prop(overlay, "show_cursor", text="3D Cursor")
sub.prop(overlay, "show_outline_selected")
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index d43000e859e..bd7334516ca 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -71,7 +71,6 @@ void BLO_update_defaults_userpref_blend(void)
/* Defaults from T54943 (phase 1). */
U.flag &= ~USER_TOOLTIPS_PYTHON;
U.uiflag |= USER_AUTOPERSP;
- U.manipulator_flag |= USER_MANIPULATOR_DRAW_NAVIGATE;
U.uiflag2 |= USER_REGION_OVERLAP;
U.versions = 1;
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 30f7742fd35..be067b0464d 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1440,7 +1440,7 @@ void DRW_draw_render_loop_ex(
if (DST.draw_ctx.evil_C) {
/* needed so manipulator isn't obscured */
if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) &&
- ((v3d->twflag & V3D_MANIPULATOR_DRAW) != 0))
+ ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0))
{
glDisable(GL_DEPTH_TEST);
DRW_draw_manipulator_3d();
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index aa71c31c541..c279c949e62 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1383,7 +1383,7 @@ void init_userdef_do_versions(Main *bmain)
if (U.rvisize == 0) {
U.rvisize = 15;
U.rvibright = 8;
- U.uiflag |= USER_SHOW_ROTVIEWICON;
+ U.uiflag |= USER_SHOW_MANIPULATOR_AXIS;
}
}
diff --git a/source/blender/editors/manipulator_library/manipulator_draw_utils.c b/source/blender/editors/manipulator_library/manipulator_draw_utils.c
index a0b226b7502..80181c57115 100644
--- a/source/blender/editors/manipulator_library/manipulator_draw_utils.c
+++ b/source/blender/editors/manipulator_library/manipulator_draw_utils.c
@@ -59,12 +59,11 @@
/**
* Main draw call for ManipulatorGeomInfo data
*/
-void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool select, const float color[4])
+void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const bool UNUSED(select), const float color[4])
{
/* TODO store the Batches inside the ManipulatorGeomInfo and updated it when geom changes
* So we don't need to re-created and discard it every time */
- const bool use_lighting = true || (!select && ((U.manipulator_flag & USER_MANIPULATOR_SHADED) != 0));
Gwn_VertBuf *vbo;
Gwn_IndexBuf *el;
Gwn_Batch *batch;
@@ -72,11 +71,6 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo
Gwn_VertFormat format = {0};
uint pos_id = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
- uint nor_id;
-
- if (use_lighting) {
- nor_id = GWN_vertformat_attr_add(&format, "nor", GWN_COMP_I16, 3, GWN_FETCH_INT_TO_FLOAT_UNIT);
- }
/* Elements */
GWN_indexbuf_init(&elb, GWN_PRIM_TRIS, info->ntris, info->nverts);
@@ -91,11 +85,6 @@ void wm_manipulator_geometryinfo_draw(const ManipulatorGeomInfo *info, const boo
GWN_vertbuf_attr_fill(vbo, pos_id, info->verts);
- if (use_lighting) {
- /* Normals are expected to be smooth. */
- GWN_vertbuf_attr_fill(vbo, nor_id, info->normals);
- }
-
batch = GWN_batch_create_ex(GWN_PRIM_TRIS, vbo, el, GWN_BATCH_OWNS_VBO | GWN_BATCH_OWNS_INDEX);
GWN_batch_program_set_builtin(batch, GPU_SHADER_3D_UNIFORM_COLOR);
diff --git a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
index a5bcef7ed5e..0430a12bc99 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/arrow3d_manipulator.c
@@ -163,16 +163,10 @@ static void arrow_draw_geom(const ArrowManipulator3D *arrow, const bool select,
const float len = 0.25f;
const float width = 0.06f;
- const bool use_lighting = (!select && ((U.manipulator_flag & USER_MANIPULATOR_SHADED) != 0));
/* translate to line end */
gpuTranslate3f(0.0f, 0.0f, arrow_length);
- if (use_lighting) {
- immUnbindProgram();
- immBindBuiltinProgram(GPU_SHADER_3D_SMOOTH_COLOR);
- }
-
imm_draw_circle_fill_3d(pos, 0.0, 0.0, width, 8);
imm_draw_cylinder_fill_3d(pos, width, 0.0, len, 8, 1);
}
diff --git a/source/blender/editors/mesh/editmesh_add_manipulator.c b/source/blender/editors/mesh/editmesh_add_manipulator.c
index bfeccfe33a4..f1704972e81 100644
--- a/source/blender/editors/mesh/editmesh_add_manipulator.c
+++ b/source/blender/editors/mesh/editmesh_add_manipulator.c
@@ -379,7 +379,7 @@ static int add_primitive_cube_manipulator_invoke(bContext *C, wmOperator *op, co
int ret = add_primitive_cube_manipulator_exec(C, op);
if (ret & OPERATOR_FINISHED) {
/* Setup manipulators */
- if (v3d && (v3d->twflag & V3D_MANIPULATOR_DRAW)) {
+ if (v3d && ((v3d->mpr_flag & V3D_MANIPULATOR_HIDE) == 0)) {
ARegion *ar = CTX_wm_region(C);
wmManipulatorMap *mmap = ar->manipulator_map;
wmManipulatorGroupType *wgt = WM_manipulatorgrouptype_find("MESH_WGT_add_bounds", false);
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 6c5133c93c8..2b6f8914a02 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -95,7 +95,7 @@ typedef struct {
/* modal only */
float mcenter[2];
void *draw_handle_pixel;
- short twflag;
+ short mpr_flag;
short value_mode; /* Which value does mouse movement and numeric input affect? */
float segments; /* Segments as float so smooth mouse pan works in small increments */
} BevelData;
@@ -201,8 +201,8 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
G.moving = G_TRANSFORM_EDIT;
if (v3d) {
- opdata->twflag = v3d->twflag;
- v3d->twflag = 0;
+ opdata->mpr_flag = v3d->mpr_flag;
+ v3d->mpr_flag = 0;
}
}
@@ -284,7 +284,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
}
ED_region_draw_cb_exit(ar->type, opdata->draw_handle_pixel);
if (v3d) {
- v3d->twflag = opdata->twflag;
+ v3d->mpr_flag = opdata->mpr_flag;
}
G.moving = 0;
}
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index 568983e47ee..ee8adeb2c52 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -70,7 +70,7 @@ typedef struct {
/* modal only */
BMBackup mesh_backup;
bool is_first;
- short twflag;
+ short mpr_flag;
} BisectData;
static bool mesh_bisect_interactive_calc(
@@ -156,8 +156,8 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event)
/* misc other vars */
G.moving = G_TRANSFORM_EDIT;
- opdata->twflag = v3d->twflag;
- v3d->twflag = 0;
+ opdata->mpr_flag = v3d->mpr_flag;
+ v3d->mpr_flag = 0;
/* initialize modal callout */
ED_workspace_status_text(C, IFACE_("LMB: Click and drag to draw cut line"));
@@ -169,7 +169,7 @@ static void edbm_bisect_exit(bContext *C, BisectData *opdata)
{
View3D *v3d = CTX_wm_view3d(C);
EDBM_redo_state_free(&opdata->mesh_backup, NULL, false);
- v3d->twflag = opdata->twflag;
+ v3d->mpr_flag = opdata->mpr_flag;
G.moving = 0;
}
@@ -199,7 +199,7 @@ static int mesh_bisect_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* Setup manipula
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list