diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:31:17 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:31:17 +0400 |
commit | 21d79cf7691b53265d15efd3f061740611415d45 (patch) | |
tree | 7f7f66dfc2f60e1165a400b762ccb8b79f340e6e | |
parent | ab960eea889b8481358b0db789b6c7cddf311248 (diff) |
Add UI and keybindings for dynamic-topology sculpt mode
* New topology panel in 3D view toolbar with the enable/disable button
for dynamic topology and other controls
* Ctrl+DKEY to toggle dynamic topology
* Shift+DKEY to show a radial control for detail size
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 30 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 12 |
2 files changed, 42 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index fb5e4a56aa1..0e1f5d8dff2 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -854,6 +854,36 @@ class VIEW3D_PT_tools_brush_curve(Panel, View3DPaintPanel): row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' +class VIEW3D_PT_sculpt_topology(Panel, View3DPaintPanel): + bl_label = "Topology" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + return (context.sculpt_object and context.tool_settings.sculpt) + + def draw(self, context): + layout = self.layout + + toolsettings = context.tool_settings + sculpt = toolsettings.sculpt + + if context.sculpt_object.use_dynamic_topology_sculpting: + layout.operator("sculpt.dynamic_topology_toggle", icon='X', text="Disable Dynamic") + else: + layout.operator("sculpt.dynamic_topology_toggle", icon='SCULPT_DYNTOPO', text="Enable Dynamic") + + col = layout.column() + col.active = context.sculpt_object.use_dynamic_topology_sculpting + col.prop(sculpt, "detail_size") + col.prop(sculpt, "use_smooth_shading") + col.prop(sculpt, "use_edge_collapse") + col.operator("sculpt.optimize") + col.separator() + col.prop(sculpt, "symmetrize_direction") + col.operator("sculpt.symmetrize") + + class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): bl_label = "Options" bl_options = {'DEFAULT_CLOSED'} diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 10b9f26dbcd..9e702c16e2f 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -648,6 +648,18 @@ void ED_keymap_paint(wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "PAINT_OT_mask_flood_fill", IKEY, KM_PRESS, KM_CTRL, 0); RNA_enum_set(kmi->ptr, "mode", PAINT_MASK_INVERT); + /* Toggle dynamic topology */ + WM_keymap_add_item(keymap, "SCULPT_OT_dynamic_topology_toggle", DKEY, KM_PRESS, KM_CTRL, 0); + + /* Dynamic-topology detail size + * + * This should be improved further, perhaps by showing a triangle + * grid rather than brush alpha */ + kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", DKEY, KM_PRESS, KM_SHIFT, 0); + set_brush_rc_props(kmi->ptr, "sculpt", "detail_size", NULL, 0); + RNA_string_set(kmi->ptr, "data_path_primary", + "tool_settings.sculpt.detail_size"); + /* multires switch */ kmi = WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "level", 1); |