[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25695] trunk/blender: * Added new hotkeys [ and ] to decrease/ increase brush size by 20 in all paint modes.
Matt Ebb
matt at mke3.net
Mon Jan 4 01:18:08 CET 2010
Revision: 25695
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25695
Author: broken
Date: 2010-01-04 01:18:08 +0100 (Mon, 04 Jan 2010)
Log Message:
-----------
* Added new hotkeys [ and ] to decrease/increase brush size by 20 in all paint modes.
The actual value to increment/decrement by can be customised in key maps.
Modified Paths:
--------------
trunk/blender/release/scripts/op/wm.py
trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
Modified: trunk/blender/release/scripts/op/wm.py
===================================================================
--- trunk/blender/release/scripts/op/wm.py 2010-01-03 23:46:19 UTC (rev 25694)
+++ trunk/blender/release/scripts/op/wm.py 2010-01-04 00:18:08 UTC (rev 25695)
@@ -61,7 +61,10 @@
def execute_context_assign(self, context):
if context_path_validate(context, self.properties.path) is Ellipsis:
return {'PASS_THROUGH'}
- exec("context.%s=self.properties.value" % self.properties.path)
+ if self.properties.relative:
+ exec("context.%s+=self.properties.value" % self.properties.path)
+ else:
+ exec("context.%s=self.properties.value" % self.properties.path)
return {'FINISHED'}
@@ -86,6 +89,8 @@
path = rna_path_prop
value = IntProperty(name="Value", description="Assign value", default=0)
+ relative = BoolProperty(name="Relative",
+ description="Apply the value as a relative difference", default=False)
execute = execute_context_assign
@@ -97,8 +102,9 @@
bl_undo = True
path = rna_path_prop
- value = FloatProperty(name="Value",
- description="Assignment value", default=0.0)
+ value = FloatProperty(name="Value", description="Assignment value", default=0.0)
+ relative = BoolProperty(name="Relative",
+ description="Apply the value as a relative difference", default=False)
execute = execute_context_assign
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2010-01-03 23:46:19 UTC (rev 25694)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_ops.c 2010-01-04 00:18:08 UTC (rev 25695)
@@ -176,6 +176,21 @@
RNA_int_set(kmi->ptr, "value", 9);
}
+static void ed_keymap_paint_brush_size(wmKeyMap *keymap, const char *path)
+{
+ wmKeyMapItem *kmi;
+
+ kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "path", path);
+ RNA_int_set(kmi->ptr, "value", -20);
+ RNA_boolean_set(kmi->ptr, "relative", 1);
+
+ kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "path", path);
+ RNA_int_set(kmi->ptr, "value", 20);
+ RNA_boolean_set(kmi->ptr, "relative", 1);
+}
+
void ED_keymap_paint(wmKeyConfig *keyconf)
{
wmKeyMap *keymap;
@@ -205,8 +220,8 @@
RNA_int_set(kmi->ptr, "level", -1);
RNA_boolean_set(kmi->ptr, "relative", 1);
- /* toggles */
ed_keymap_paint_brush_switch(keymap, "tool_settings.sculpt.active_brush_index");
+ ed_keymap_paint_brush_size(keymap, "tool_settings.sculpt.brush.size");
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", AKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_anchor");
@@ -259,6 +274,7 @@
"PAINT_OT_vertex_color_set",KKEY, KM_PRESS, KM_SHIFT, 0);
ed_keymap_paint_brush_switch(keymap, "tool_settings.vertex_paint.active_brush_index");
+ ed_keymap_paint_brush_size(keymap, "tool_settings.vertex_paint.brush.size");
/* Weight Paint mode */
keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
@@ -273,6 +289,7 @@
"PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
ed_keymap_paint_brush_switch(keymap, "tool_settings.weight_paint.active_brush_index");
+ ed_keymap_paint_brush_size(keymap, "tool_settings.weight_paint.brush.size");
/* Image/Texture Paint mode */
keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
@@ -286,6 +303,7 @@
WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
ed_keymap_paint_brush_switch(keymap, "tool_settings.image_paint.active_brush_index");
+ ed_keymap_paint_brush_size(keymap, "tool_settings.image_paint.brush.size");
/* face-mask mode */
keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0);
More information about the Bf-blender-cvs
mailing list