Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2011-05-12 05:57:47 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2011-05-12 05:57:47 +0400
commit910220be47729d6effffb7aa33bfe05d4caa5d3d (patch)
treeecc0d3c6c5073aee112ed5946ec7882ee4bfe236 /source/blender/editors/physics/physics_ops.c
parent040f65f6c29a8d5b624d4dd5b3083d8519d4a8c1 (diff)
== Radial control ==
Patch to make the radial control more generic with RNA. Patch was reviewed here: http://codereview.appspot.com/4280080/ Prior to this update, the radial control code in trunk had generic parts of the radial control implemented as an incomplete operator within WM. Then each different user of the radial control had to implement a separate operator to actually pass in specific brush data -- e.g. sculpt's brush size, vpaint's brush size, etc. This patch removes all the extra operators and makes the WM operator do everything. It now takes several RNA path strings as its properties -- the only required property is data_path, which specifies the data to be modified by the radial control. The other paths affect display in various ways, e.g. rotation, color, etc. In addition to decreasing some duplicate paint brush code, these updates make it pretty easy to enable radial control for other purposes (and it can be set up entirely though python or keymaps, no extra C code needed.)
Diffstat (limited to 'source/blender/editors/physics/physics_ops.c')
-rw-r--r--source/blender/editors/physics/physics_ops.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c
index 02b2fad7a00..aafa5a185ed 100644
--- a/source/blender/editors/physics/physics_ops.c
+++ b/source/blender/editors/physics/physics_ops.c
@@ -66,7 +66,6 @@ static void operatortypes_particle(void)
WM_operatortype_append(PARTICLE_OT_mirror);
WM_operatortype_append(PARTICLE_OT_brush_edit);
- WM_operatortype_append(PARTICLE_OT_brush_radial_control);
WM_operatortype_append(PARTICLE_OT_particle_edit_toggle);
WM_operatortype_append(PARTICLE_OT_edited_clear);
@@ -91,6 +90,7 @@ static void operatortypes_particle(void)
static void keymap_particle(wmKeyConfig *keyconf)
{
+ wmKeyMapItem *kmi;
wmKeyMap *keymap;
keymap= WM_keymap_find(keyconf, "Particle", 0, 0);
@@ -112,8 +112,14 @@ static void keymap_particle(wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PARTICLE_OT_brush_edit", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
- RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
- RNA_enum_set(WM_keymap_add_item(keymap, "PARTICLE_OT_brush_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
+
+ /* size radial control */
+ kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.particle_edit.brush.size");
+
+ /* size radial control */
+ kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.particle_edit.brush.strength");
WM_keymap_add_menu(keymap, "VIEW3D_MT_particle_specials", WKEY, KM_PRESS, 0, 0);