Manipulator: ruler tool

Add the 3D view ruler as a tool,
the modal operator remains for now
however it may be removed if we use the tool-system for 2.8.

Note that this does copy code from the operator,
its different enough not to attempt to de-duplicate.
This commit is contained in:
Campbell Barton 2017-11-11 02:43:04 +11:00
parent 63830cd6a9
commit 0260fad9ba
6 changed files with 1094 additions and 1 deletions

@ -60,6 +60,9 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
("Scale", None,
(("transform.resize", dict(release_confirm=True), dict(type='EVT_TWEAK_A', value='ANY')),)),
("Scale Cage", "VIEW3D_WGT_xform_cage", None),
None,
("Ruler/Protractor", "VIEW3D_WGT_ruler",
(("view3d.ruler_add", dict(), dict(type='EVT_TWEAK_A', value='ANY')),)),
)
_tools = {

@ -64,6 +64,7 @@ set(SRC
view3d_manipulator_empty.c
view3d_manipulator_forcefield.c
view3d_manipulator_lamp.c
view3d_manipulator_ruler.c
view3d_ops.c
view3d_project.c
view3d_ruler.c

@ -724,6 +724,9 @@ static void view3d_widgets(void)
WM_manipulatorgrouptype_append_and_link(mmap_type, VIEW3D_WGT_armature_spline);
WM_manipulatorgrouptype_append(VIEW3D_WGT_xform_cage);
WM_manipulatorgrouptype_append(VIEW3D_WGT_ruler);
WM_manipulatortype_append(VIEW3D_WT_ruler_item);
}

@ -50,9 +50,10 @@ struct bPoseChannel;
struct Mesh;
struct SceneLayer;
struct wmOperatorType;
struct wmWindowManager;
struct wmKeyConfig;
struct wmManipulatorGroupType;
struct wmManipulatorType;
struct wmWindowManager;
/* drawing flags: */
enum {
@ -338,6 +339,10 @@ void VIEW3D_WGT_force_field(struct wmManipulatorGroupType *wgt);
void VIEW3D_WGT_empty_image(struct wmManipulatorGroupType *wgt);
void VIEW3D_WGT_armature_spline(struct wmManipulatorGroupType *wgt);
void VIEW3D_WGT_ruler(struct wmManipulatorGroupType *wgt);
void VIEW3D_WT_ruler_item(struct wmManipulatorType *wt);
void VIEW3D_OT_ruler_add(struct wmOperatorType *ot);
/* draw_volume.c */
void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob,
const float min[3], const float max[3],

File diff suppressed because it is too large Load Diff

@ -222,6 +222,8 @@ void view3d_operatortypes(void)
WM_operatortype_append(VIEW3D_OT_toggle_render);
WM_operatortype_append(VIEW3D_OT_ruler_add);
transform_operatortypes();
}