[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53449] trunk/blender: Add UI and keybindings for dynamic-topology sculpt mode
Nicholas Bishop
nicholasbishop at gmail.com
Sun Dec 30 19:31:18 CET 2012
Revision: 53449
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53449
Author: nicholasbishop
Date: 2012-12-30 18:31:17 +0000 (Sun, 30 Dec 2012)
Log Message:
-----------
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
Modified Paths:
--------------
trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2012-12-30 18:31:01 UTC (rev 53448)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2012-12-30 18:31:17 UTC (rev 53449)
@@ -854,6 +854,36 @@
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'}
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2012-12-30 18:31:01 UTC (rev 53448)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2012-12-30 18:31:17 UTC (rev 53449)
@@ -648,6 +648,18 @@
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);
More information about the Bf-blender-cvs
mailing list