Tools: Add Randomize to Curve Edit toolbar

This commit is contained in:
William Reynish
2019-03-03 20:37:47 +01:00
parent 40052708e6
commit a6c30dd91c
4 changed files with 28 additions and 0 deletions

Binary file not shown.

View File

@@ -5673,6 +5673,15 @@ def km_3d_view_tool_edit_curve_shrink_fatten(params):
]},
)
def km_3d_view_tool_edit_curve_randomize(params):
return (
"3D View Tool: Edit Curve, Randomize",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.vertex_random", {"type": params.tool_tweak, "value": 'ANY'},
{"properties": [("offset", 0.0)]}),
]},
)
def km_3d_view_tool_edit_curve_extrude(params):
return (
@@ -6146,6 +6155,7 @@ def generate_keymaps(params=None):
km_3d_view_tool_edit_curve_draw(params),
km_3d_view_tool_edit_curve_shrink_fatten(params),
km_3d_view_tool_edit_curve_tilt(params),
km_3d_view_tool_edit_curve_randomize(params),
km_3d_view_tool_edit_curve_extrude(params),
km_3d_view_tool_edit_curve_extrude_cursor(params),
km_3d_view_tool_sculpt_box_hide(params),

View File

@@ -811,6 +811,22 @@ class _defs_edit_curve:
keymap=(),
)
@ToolDef.from_fn
def curve_vertex_randomize():
def draw_settings(context, layout, tool):
props = tool.operator_properties("transform.vertex_random")
layout.prop(props, "uniform")
layout.prop(props, "normal")
layout.prop(props, "seed")
return dict(
text="Randomize",
icon="ops.curve.vertex_random",
widget="WM_GGT_value_operator_redo",
keymap=(),
draw_settings=draw_settings,
)
class _defs_pose:
@ToolDef.from_fn
@@ -1600,6 +1616,7 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
*_tools_default,
None,
_defs_edit_curve.curve_shrink_fatten,
_defs_edit_curve.curve_vertex_randomize,
_defs_edit_curve.tilt,
_defs_edit_curve.draw,
(

View File

@@ -669,6 +669,7 @@ set_property(GLOBAL PROPERTY ICON_GEOM_NAMES
ops.curve.extrude_cursor
ops.curve.extrude_move
ops.curve.shrink_fatten
ops.curve.vertex_random
ops.generic.cursor
ops.generic.select
ops.generic.select_box