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.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user