forked from bartvdbraak/blender
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:
parent
63830cd6a9
commit
0260fad9ba
@ -60,6 +60,9 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
|
|||||||
("Scale", None,
|
("Scale", None,
|
||||||
(("transform.resize", dict(release_confirm=True), dict(type='EVT_TWEAK_A', value='ANY')),)),
|
(("transform.resize", dict(release_confirm=True), dict(type='EVT_TWEAK_A', value='ANY')),)),
|
||||||
("Scale Cage", "VIEW3D_WGT_xform_cage", None),
|
("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 = {
|
_tools = {
|
||||||
|
@ -64,6 +64,7 @@ set(SRC
|
|||||||
view3d_manipulator_empty.c
|
view3d_manipulator_empty.c
|
||||||
view3d_manipulator_forcefield.c
|
view3d_manipulator_forcefield.c
|
||||||
view3d_manipulator_lamp.c
|
view3d_manipulator_lamp.c
|
||||||
|
view3d_manipulator_ruler.c
|
||||||
view3d_ops.c
|
view3d_ops.c
|
||||||
view3d_project.c
|
view3d_project.c
|
||||||
view3d_ruler.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_and_link(mmap_type, VIEW3D_WGT_armature_spline);
|
||||||
|
|
||||||
WM_manipulatorgrouptype_append(VIEW3D_WGT_xform_cage);
|
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 Mesh;
|
||||||
struct SceneLayer;
|
struct SceneLayer;
|
||||||
struct wmOperatorType;
|
struct wmOperatorType;
|
||||||
struct wmWindowManager;
|
|
||||||
struct wmKeyConfig;
|
struct wmKeyConfig;
|
||||||
struct wmManipulatorGroupType;
|
struct wmManipulatorGroupType;
|
||||||
|
struct wmManipulatorType;
|
||||||
|
struct wmWindowManager;
|
||||||
|
|
||||||
/* drawing flags: */
|
/* drawing flags: */
|
||||||
enum {
|
enum {
|
||||||
@ -338,6 +339,10 @@ void VIEW3D_WGT_force_field(struct wmManipulatorGroupType *wgt);
|
|||||||
void VIEW3D_WGT_empty_image(struct wmManipulatorGroupType *wgt);
|
void VIEW3D_WGT_empty_image(struct wmManipulatorGroupType *wgt);
|
||||||
void VIEW3D_WGT_armature_spline(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 */
|
/* draw_volume.c */
|
||||||
void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob,
|
void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob,
|
||||||
const float min[3], const float max[3],
|
const float min[3], const float max[3],
|
||||||
|
1079
source/blender/editors/space_view3d/view3d_manipulator_ruler.c
Normal file
1079
source/blender/editors/space_view3d/view3d_manipulator_ruler.c
Normal file
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_toggle_render);
|
||||||
|
|
||||||
|
WM_operatortype_append(VIEW3D_OT_ruler_add);
|
||||||
|
|
||||||
transform_operatortypes();
|
transform_operatortypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user