diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 10:47:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 10:52:26 +0300 |
commit | 7b14065729af4266bffbf70ef0de3bd646ec555c (patch) | |
tree | bbb13136b933e369227cea9f1baafdc455a93806 /source/blender/makesrna/intern | |
parent | 2ecb9856bc3a77354c9785a7119a0904d11e0d8c (diff) |
Manipulator: de-duplicate flags and scale option
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 35 |
2 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 38fbdbd895e..364059d9c72 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2678,7 +2678,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update"); prop = RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); + 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_ui_icon(prop, ICON_MANIPUL, 0); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 1d01e85205c..af77d037b69 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -176,10 +176,12 @@ static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, Point for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; - if (userdef->tw_flag & V3D_USE_MANIPULATOR) - v3d->twflag |= V3D_USE_MANIPULATOR; - else - v3d->twflag &= ~V3D_USE_MANIPULATOR; + if (userdef->manipulator_flag & USER_MANIPULATOR_DRAW) { + v3d->twflag |= V3D_MANIPULATOR_DRAW; + } + else { + v3d->twflag &= ~V3D_MANIPULATOR_DRAW; + } } } } @@ -3496,30 +3498,25 @@ 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, "tw_flag", V3D_USE_MANIPULATOR); + 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"); + /* 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_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, "tw_size"); + RNA_def_property_int_sdna(prop, NULL, "manipulator_size"); RNA_def_property_range(prop, 10, 200); RNA_def_property_int_default(prop, 75); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of the manipulator"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - prop = RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_PERCENTAGE); - RNA_def_property_int_sdna(prop, NULL, "tw_handlesize"); - RNA_def_property_range(prop, 2, 40); - RNA_def_property_int_default(prop, 25); - RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of manipulator handles as percentage of the radius"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); - - prop = RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_PIXEL); - RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); - RNA_def_property_range(prop, 4, 40); - RNA_def_property_int_default(prop, 14); - RNA_def_property_ui_text(prop, "Manipulator Hotspot", "Distance around the handles to accept mouse clicks"); - prop = RNA_def_property(srna, "object_origin_size", PROP_INT, PROP_PIXEL); RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); |