diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 11:38:01 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-11 11:49:18 +0300 |
commit | c17611af951e46fb82bf43d7449240f2f829b78f (patch) | |
tree | 51992764ea21b663b68c6aabb11fea843d115474 /source/blender/makesrna | |
parent | 64d40c82c324f7029e27ff59a4b1ca3200cddbef (diff) |
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
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 19 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 60 |
2 files changed, 29 insertions, 50 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 752972b0797..67c345914dc 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2926,8 +2926,23 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_MANIPULATOR_DRAW); - RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms"); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE); + RNA_def_property_ui_text(prop, "Manipulator", "Show manipulators of all types"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_NAVIGATE); + RNA_def_property_ui_text(prop, "Navigate Manipulator", ""); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_manipulator_context", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_CONTEXT); + RNA_def_property_ui_text(prop, "Context Manipulator", "Context sensitive manipulators for the active item"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_manipulator_tool", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mpr_flag", V3D_MANIPULATOR_HIDE_TOOL); + RNA_def_property_ui_text(prop, "Tool Manipulator", "Active tool manipulator"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); prop = RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index aa6eb4c4dc2..517e4047515 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -165,36 +165,6 @@ static void rna_userdef_language_update(Main *UNUSED(bmain), Scene *UNUSED(scene UI_reinit_font(); } -static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr) -{ - UserDef *userdef = (UserDef *)ptr->data; - - /* lame, loop over all views and set */ - bScreen *sc; - ScrArea *sa; - SpaceLink *sl; - - /* from scene copy to the other views */ - for (sc = bmain->screen.first; sc; sc = sc->id.next) { - for (sa = sc->areabase.first; sa; sa = sa->next) { - for (sl = sa->spacedata.first; sl; sl = sl->next) { - if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D *)sl; - if (userdef->manipulator_flag & USER_MANIPULATOR_DRAW) { - v3d->twflag |= V3D_MANIPULATOR_DRAW; - } - else { - v3d->twflag &= ~V3D_MANIPULATOR_DRAW; - } - } - } - } - } - - rna_userdef_update(bmain, scene, ptr); -} - - static void rna_userdef_script_autoexec_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { UserDef *userdef = (UserDef *)ptr->data; @@ -3733,10 +3703,17 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Rotate Around Selection", "Use selection as the pivot point"); /* mini axis */ - prop = RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); - RNA_def_property_ui_text(prop, "Show Mini Axes", - "Show a small rotating 3D axes in the bottom left corner of the 3D View"); + static const EnumPropertyItem mini_axis_type_items[] = { + {0, "MINIMAL", 0, "Simple Axis", ""}, + {USER_SHOW_MANIPULATOR_AXIS, "MANIPULATOR", 0, "Interactive Navigation", ""}, + {0, NULL, 0, NULL, NULL} + }; + + prop = RNA_def_property(srna, "mini_axis_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, mini_axis_type_items); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "uiflag"); + RNA_def_property_ui_text(prop, "Mini Axes Type", + "Show a small rotating 3D axes in the top right corner of the 3D View"); RNA_def_property_update(prop, 0, "rna_userdef_update"); prop = RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE); @@ -3764,21 +3741,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) /* 3D transform widget */ prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW); - RNA_def_property_ui_text(prop, "Manipulator", "Use 3D transform manipulator"); - RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); - - prop = RNA_def_property(srna, "show_manipulator_navigate", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_DRAW_NAVIGATE); - RNA_def_property_ui_text(prop, "Navigate Manipulator", "Use 3D navigation manipulator"); - RNA_def_property_update(prop, 0, "rna_userdef_show_manipulator_update"); - - /* TODO, expose once it's working. */ -#if 0 - prop = RNA_def_property(srna, "show_manipulator_shaded", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "manipulator_flag", USER_MANIPULATOR_SHADED); - RNA_def_property_ui_text(prop, "Manipulator Shaded", "Use 3D transform manipulator"); + RNA_def_property_ui_text(prop, "Manipulators", "Use transform manipulators by default"); RNA_def_property_update(prop, 0, "rna_userdef_update"); -#endif prop = RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "manipulator_size"); |