[Bf-blender-cvs] [16b807e84f5] blender2.8: Manipulator: flip scale flag usage
Campbell Barton
noreply at git.blender.org
Fri Jun 23 07:49:14 CEST 2017
Commit: 16b807e84f5d1a1f42db7bbb68cfcc0b160e995c
Author: Campbell Barton
Date: Fri Jun 23 15:50:55 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB16b807e84f5d1a1f42db7bbb68cfcc0b160e995c
Manipulator: flip scale flag usage
Naming was confusing, while technically correct -
the result is no scaling (manipulator ignores zoom-level).
Also remove 3D from name since this can be supported for 2D views too.
===================================================================
M source/blender/editors/mesh/editmesh_bisect.c
M source/blender/editors/mesh/editmesh_extrude.c
M source/blender/editors/space_view3d/view3d_manipulators.c
M source/blender/editors/transform/transform_manipulator.c
M source/blender/windowmanager/manipulators/WM_manipulator_types.h
M source/blender/windowmanager/manipulators/intern/wm_manipulator.c
===================================================================
diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c
index d6dd3fbaa64..cdfc7c19308 100644
--- a/source/blender/editors/mesh/editmesh_bisect.c
+++ b/source/blender/editors/mesh/editmesh_bisect.c
@@ -673,8 +673,7 @@ static void MESH_WGT_bisect(struct wmManipulatorGroupType *wgt)
wgt->name = "Mesh Bisect";
wgt->idname = "MESH_WGT_bisect";
- wgt->flag = (WM_MANIPULATORGROUPTYPE_3D |
- WM_MANIPULATORGROUPTYPE_SCALE_3D);
+ wgt->flag = WM_MANIPULATORGROUPTYPE_3D;
wgt->mmap_params.spaceid = SPACE_VIEW3D;
wgt->mmap_params.regionid = RGN_TYPE_WINDOW;
diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c
index ce25d3f1a15..8f3911c5928 100644
--- a/source/blender/editors/mesh/editmesh_extrude.c
+++ b/source/blender/editors/mesh/editmesh_extrude.c
@@ -1147,8 +1147,7 @@ static void MESH_WGT_spin(struct wmManipulatorGroupType *wgt)
wgt->name = "Mesh Spin";
wgt->idname = "MESH_WGT_spin";
- wgt->flag = (WM_MANIPULATORGROUPTYPE_3D |
- WM_MANIPULATORGROUPTYPE_SCALE_3D);
+ wgt->flag = WM_MANIPULATORGROUPTYPE_3D;
wgt->mmap_params.spaceid = SPACE_VIEW3D;
wgt->mmap_params.regionid = RGN_TYPE_WINDOW;
diff --git a/source/blender/editors/space_view3d/view3d_manipulators.c b/source/blender/editors/space_view3d/view3d_manipulators.c
index 4d1357e1297..71999143613 100644
--- a/source/blender/editors/space_view3d/view3d_manipulators.c
+++ b/source/blender/editors/space_view3d/view3d_manipulators.c
@@ -113,8 +113,7 @@ void VIEW3D_WGT_lamp(wmManipulatorGroupType *wgt)
wgt->idname = "VIEW3D_WGT_lamp";
wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT |
- WM_MANIPULATORGROUPTYPE_3D |
- WM_MANIPULATORGROUPTYPE_SCALE_3D);
+ WM_MANIPULATORGROUPTYPE_3D);
wgt->poll = WIDGETGROUP_lamp_poll;
wgt->setup = WIDGETGROUP_lamp_setup;
@@ -292,7 +291,8 @@ void VIEW3D_WGT_camera(wmManipulatorGroupType *wgt)
wgt->idname = "VIEW3D_WGT_camera";
wgt->flag = (WM_MANIPULATORGROUPTYPE_PERSISTENT |
- WM_MANIPULATORGROUPTYPE_3D);
+ WM_MANIPULATORGROUPTYPE_3D |
+ WM_MANIPULATORGROUPTYPE_SCALE);
wgt->poll = WIDGETGROUP_camera_poll;
wgt->setup = WIDGETGROUP_camera_setup;
@@ -360,7 +360,8 @@ void VIEW3D_WGT_force_field(wmManipulatorGroupType *wgt)
wgt->idname = "VIEW3D_WGT_force_field";
wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT |
- WM_MANIPULATORGROUPTYPE_3D);
+ WM_MANIPULATORGROUPTYPE_3D |
+ WM_MANIPULATORGROUPTYPE_SCALE);
wgt->poll = WIDGETGROUP_forcefield_poll;
wgt->setup = WIDGETGROUP_forcefield_setup;
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index 6818de6ad25..02a6ead9925 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -1401,8 +1401,7 @@ void TRANSFORM_WGT_manipulator(wmManipulatorGroupType *wgt)
wgt->idname = "TRANSFORM_WGT_manipulator";
wgt->flag |= (WM_MANIPULATORGROUPTYPE_PERSISTENT |
- WM_MANIPULATORGROUPTYPE_3D |
- WM_MANIPULATORGROUPTYPE_SCALE_3D);
+ WM_MANIPULATORGROUPTYPE_3D);
wgt->poll = WIDGETGROUP_manipulator_poll;
wgt->setup = WIDGETGROUP_manipulator_setup;
diff --git a/source/blender/windowmanager/manipulators/WM_manipulator_types.h b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
index 5c6bfe02e0b..fd39626f38f 100644
--- a/source/blender/windowmanager/manipulators/WM_manipulator_types.h
+++ b/source/blender/windowmanager/manipulators/WM_manipulator_types.h
@@ -336,8 +336,9 @@ enum eManipulatorMapTypeUpdateFlags {
enum {
/* Mark manipulator-group as being 3D */
WM_MANIPULATORGROUPTYPE_3D = (1 << 0),
- /* Scale manipulators as 3D object that respects zoom (otherwise zoom independent draw size) */
- WM_MANIPULATORGROUPTYPE_SCALE_3D = (1 << 1),
+ /* Scale manipulators as 3D object that respects zoom (otherwise zoom independent draw size).
+ * note: currently only for 3D views, 2D support needs adding. */
+ WM_MANIPULATORGROUPTYPE_SCALE = (1 << 1),
/* Manipulators can be depth culled with scene objects (covered by other geometry - TODO) */
WM_MANIPULATORGROUPTYPE_DEPTH_3D = (1 << 2),
/* Manipulators can be selected */
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
index 5daea3149d6..ba0e720485a 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c
@@ -446,7 +446,7 @@ void wm_manipulator_calculate_scale(wmManipulator *mpr, const bContext *C)
const RegionView3D *rv3d = CTX_wm_region_view3d(C);
float scale = U.ui_scale;
- if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_SCALE_3D) {
+ if ((mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_SCALE) == 0) {
scale *= U.manipulator_size;
if (rv3d) {
/* 'ED_view3d_pixel_size' includes 'U.pixelsize', remove it. */
More information about the Bf-blender-cvs
mailing list