2009-08-16 19:50:00 +00:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2009-08-17 02:49:31 +00:00
|
|
|
#include "DNA_brush_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
2009-08-16 19:50:00 +00:00
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_brush.h"
|
|
|
|
|
#include "BKE_context.h"
|
|
|
|
|
#include "BKE_paint.h"
|
2009-02-19 23:53:40 +00:00
|
|
|
|
|
|
|
|
#include "ED_sculpt.h"
|
2009-10-22 12:59:14 +00:00
|
|
|
#include "ED_screen.h"
|
2009-08-17 02:49:31 +00:00
|
|
|
#include "UI_resources.h"
|
2009-02-19 23:53:40 +00:00
|
|
|
|
|
|
|
|
#include "WM_api.h"
|
|
|
|
|
#include "WM_types.h"
|
|
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
#include "RNA_access.h"
|
|
|
|
|
#include "RNA_define.h"
|
|
|
|
|
#include "RNA_enum_types.h"
|
|
|
|
|
|
2009-02-19 23:53:40 +00:00
|
|
|
#include "paint_intern.h"
|
2009-09-18 15:48:49 +00:00
|
|
|
#include "sculpt_intern.h"
|
2009-02-19 23:53:40 +00:00
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
/* Brush operators */
|
2009-08-17 02:49:31 +00:00
|
|
|
static int brush_add_exec(bContext *C, wmOperator *op)
|
2009-08-16 19:50:00 +00:00
|
|
|
{
|
2009-08-17 15:05:18 +00:00
|
|
|
/*int type = RNA_enum_get(op->ptr, "type");*/
|
2009-08-16 19:50:00 +00:00
|
|
|
Brush *br = NULL;
|
|
|
|
|
|
2009-08-17 15:05:18 +00:00
|
|
|
br = add_brush("Brush");
|
2009-08-17 02:49:31 +00:00
|
|
|
|
2009-08-17 15:05:18 +00:00
|
|
|
if(br)
|
2009-08-16 19:50:00 +00:00
|
|
|
paint_brush_set(paint_get_active(CTX_data_scene(C)), br);
|
2009-10-22 12:59:14 +00:00
|
|
|
|
2009-08-16 19:50:00 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-17 02:49:31 +00:00
|
|
|
static EnumPropertyItem brush_type_items[] = {
|
|
|
|
|
{OB_MODE_SCULPT, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""},
|
|
|
|
|
{OB_MODE_VERTEX_PAINT, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""},
|
|
|
|
|
{OB_MODE_WEIGHT_PAINT, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""},
|
|
|
|
|
{OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
|
|
|
|
|
{0, NULL, 0, NULL, NULL}};
|
|
|
|
|
|
|
|
|
|
void BRUSH_OT_add(wmOperatorType *ot)
|
2009-08-16 19:50:00 +00:00
|
|
|
{
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name= "Add Brush";
|
2009-09-12 17:16:12 +00:00
|
|
|
ot->description= "Add brush by mode type.";
|
2009-08-17 02:49:31 +00:00
|
|
|
ot->idname= "BRUSH_OT_add";
|
2009-08-16 19:50:00 +00:00
|
|
|
|
|
|
|
|
/* api callbacks */
|
2009-08-17 02:49:31 +00:00
|
|
|
ot->exec= brush_add_exec;
|
2009-08-16 19:50:00 +00:00
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
|
|
|
|
|
2009-08-17 02:49:31 +00:00
|
|
|
RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_VERTEX_PAINT, "Type", "Which paint mode to create the brush for.");
|
2009-08-16 19:50:00 +00:00
|
|
|
}
|
|
|
|
|
|
2009-08-22 02:27:37 +00:00
|
|
|
static int vertex_color_set_exec(bContext *C, wmOperator *op)
|
|
|
|
|
{
|
|
|
|
|
Scene *scene = CTX_data_scene(C);
|
2009-10-22 12:59:14 +00:00
|
|
|
Object *obact = CTX_data_active_object(C);
|
|
|
|
|
unsigned int paintcol = vpaint_get_current_col(scene->toolsettings->vpaint);
|
|
|
|
|
vpaint_fill(obact, paintcol);
|
2009-08-22 02:27:37 +00:00
|
|
|
|
2009-10-22 12:59:14 +00:00
|
|
|
ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
|
2009-08-22 02:27:37 +00:00
|
|
|
return OPERATOR_FINISHED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void PAINT_OT_vertex_color_set(wmOperatorType *ot)
|
|
|
|
|
{
|
|
|
|
|
/* identifiers */
|
|
|
|
|
ot->name= "Set Vertex Colors";
|
|
|
|
|
ot->idname= "PAINT_OT_vertex_color_set";
|
|
|
|
|
|
|
|
|
|
/* api callbacks */
|
|
|
|
|
ot->exec= vertex_color_set_exec;
|
|
|
|
|
ot->poll= vertex_paint_mode_poll;
|
|
|
|
|
|
|
|
|
|
/* flags */
|
|
|
|
|
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
|
|
|
|
|
}
|
|
|
|
|
|
2009-02-19 23:53:40 +00:00
|
|
|
/**************************** registration **********************************/
|
|
|
|
|
|
|
|
|
|
void ED_operatortypes_paint(void)
|
|
|
|
|
{
|
2009-08-14 04:45:29 +00:00
|
|
|
/* brush */
|
2009-08-17 02:49:31 +00:00
|
|
|
WM_operatortype_append(BRUSH_OT_add);
|
2009-08-14 04:45:29 +00:00
|
|
|
WM_operatortype_append(BRUSH_OT_curve_preset);
|
|
|
|
|
|
2009-02-19 23:53:40 +00:00
|
|
|
/* image */
|
|
|
|
|
WM_operatortype_append(PAINT_OT_texture_paint_toggle);
|
2009-02-22 19:31:25 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_texture_paint_radial_control);
|
2009-02-19 23:53:40 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_image_paint);
|
2009-02-22 19:31:25 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_image_paint_radial_control);
|
2009-02-19 23:53:40 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_sample_color);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_grab_clone);
|
2009-03-29 02:15:13 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_clone_cursor_set);
|
2009-02-19 23:53:40 +00:00
|
|
|
|
|
|
|
|
/* weight */
|
|
|
|
|
WM_operatortype_append(PAINT_OT_weight_paint_toggle);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_weight_paint_radial_control);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_weight_paint);
|
2009-10-22 12:59:14 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_weight_set);
|
2009-02-19 23:53:40 +00:00
|
|
|
|
|
|
|
|
/* vertex */
|
|
|
|
|
WM_operatortype_append(PAINT_OT_vertex_paint_radial_control);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_vertex_paint);
|
2009-08-22 02:27:37 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_vertex_color_set);
|
2009-10-22 19:17:46 +00:00
|
|
|
|
|
|
|
|
/* face-select */
|
|
|
|
|
WM_operatortype_append(PAINT_OT_face_select_linked);
|
|
|
|
|
WM_operatortype_append(PAINT_OT_face_select_linked_pick);
|
2009-11-29 22:16:29 +00:00
|
|
|
WM_operatortype_append(PAINT_OT_face_select_all);
|
2009-02-19 23:53:40 +00:00
|
|
|
}
|
|
|
|
|
|
2009-11-17 16:04:17 +00:00
|
|
|
static void ed_keymap_paint_brush_switch(wmKeyMap *keymap, const char *path)
|
|
|
|
|
{
|
|
|
|
|
wmKeyMapItem *kmi;
|
|
|
|
|
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 0);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", TWOKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 1);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", THREEKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 2);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FOURKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 3);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", FIVEKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 4);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SIXKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 5);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", SEVENKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 6);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", EIGHTKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 7);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", NINEKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
|
|
|
|
RNA_int_set(kmi->ptr, "value", 8);
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "WM_OT_context_set_int", ZEROKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", path);
|
2009-12-17 21:20:18 +00:00
|
|
|
RNA_int_set(kmi->ptr, "value", 9);
|
2009-11-17 16:04:17 +00:00
|
|
|
}
|
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void ED_keymap_paint(wmKeyConfig *keyconf)
|
2009-09-18 15:48:49 +00:00
|
|
|
{
|
|
|
|
|
wmKeyMap *keymap;
|
2009-12-23 12:13:48 +00:00
|
|
|
wmKeyMapItem *kmi;
|
2009-12-07 19:56:59 +00:00
|
|
|
int i;
|
2009-09-18 15:48:49 +00:00
|
|
|
|
|
|
|
|
/* Sculpt mode */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Sculpt", 0, 0);
|
2009-09-18 15:48:49 +00:00
|
|
|
keymap->poll= sculpt_poll;
|
|
|
|
|
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, KM_CTRL, 0)->ptr, "mode", WM_RADIALCONTROL_ANGLE);
|
|
|
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "SCULPT_OT_brush_stroke", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
|
2009-11-17 16:04:17 +00:00
|
|
|
ed_keymap_paint_brush_switch(keymap, "tool_settings.sculpt.active_brush_index");
|
|
|
|
|
|
2009-12-23 12:13:48 +00:00
|
|
|
for(i=0; i<=5; i++)
|
2009-12-07 19:56:59 +00:00
|
|
|
RNA_int_set(WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", ZEROKEY+i, KM_PRESS, KM_CTRL, 0)->ptr, "level", i);
|
|
|
|
|
|
2009-12-23 12:13:48 +00:00
|
|
|
/* multires switch */
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEUPKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(kmi->ptr, "level", 1);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "relative", 1);
|
|
|
|
|
|
|
|
|
|
kmi= WM_keymap_add_item(keymap, "OBJECT_OT_subdivision_set", PAGEDOWNKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_int_set(kmi->ptr, "level", -1);
|
|
|
|
|
RNA_boolean_set(kmi->ptr, "relative", 1);
|
|
|
|
|
|
|
|
|
|
/* toggles */
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", SKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.use_smooth_stroke");
|
|
|
|
|
|
|
|
|
|
/* brush switching */
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", DKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "DRAW");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", SKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "SMOOTH");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "PINCH");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", GKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "GRAB");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", LKEY, KM_PRESS, 0, 0);
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "LAYER");
|
|
|
|
|
|
|
|
|
|
kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", TKEY, KM_PRESS, KM_SHIFT, 0); /* was just T in 2.4x */
|
|
|
|
|
RNA_string_set(kmi->ptr, "path", "tool_settings.sculpt.brush.sculpt_tool");
|
|
|
|
|
RNA_string_set(kmi->ptr, "value", "FLATTEN");
|
|
|
|
|
|
|
|
|
|
|
2009-09-18 15:48:49 +00:00
|
|
|
/* Vertex Paint mode */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Vertex Paint", 0, 0);
|
2009-09-18 15:48:49 +00:00
|
|
|
keymap->poll= vertex_paint_poll;
|
|
|
|
|
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
WM_keymap_verify_item(keymap, "PAINT_OT_vertex_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
|
2009-10-22 12:59:14 +00:00
|
|
|
WM_keymap_add_item(keymap,
|
|
|
|
|
"PAINT_OT_vertex_color_set",KKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
|
2009-11-17 16:04:17 +00:00
|
|
|
ed_keymap_paint_brush_switch(keymap, "tool_settings.vertex_paint.active_brush_index");
|
|
|
|
|
|
2009-09-18 15:48:49 +00:00
|
|
|
/* Weight Paint mode */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Weight Paint", 0, 0);
|
2009-09-18 15:48:49 +00:00
|
|
|
keymap->poll= weight_paint_poll;
|
|
|
|
|
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
|
|
|
|
|
WM_keymap_verify_item(keymap, "PAINT_OT_weight_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
|
2009-10-22 12:59:14 +00:00
|
|
|
WM_keymap_add_item(keymap,
|
|
|
|
|
"PAINT_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0);
|
|
|
|
|
|
2009-11-17 16:04:17 +00:00
|
|
|
ed_keymap_paint_brush_switch(keymap, "tool_settings.weight_paint.active_brush_index");
|
|
|
|
|
|
2009-09-18 15:48:49 +00:00
|
|
|
/* Image/Texture Paint mode */
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
keymap= WM_keymap_find(keyconf, "Image Paint", 0, 0);
|
2009-09-18 15:48:49 +00:00
|
|
|
keymap->poll= image_texture_paint_poll;
|
|
|
|
|
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE);
|
|
|
|
|
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_texture_paint_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "mode", WM_RADIALCONTROL_STRENGTH);
|
|
|
|
|
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", RIGHTMOUSE, KM_PRESS, 0, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_clone_cursor_set", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
|
2009-11-17 16:04:17 +00:00
|
|
|
ed_keymap_paint_brush_switch(keymap, "tool_settings.image_paint.active_brush_index");
|
|
|
|
|
|
2009-10-22 19:17:46 +00:00
|
|
|
/* face-mask mode */
|
|
|
|
|
keymap= WM_keymap_find(keyconf, "Face Mask", 0, 0);
|
|
|
|
|
keymap->poll= facemask_paint_poll;
|
|
|
|
|
|
2009-11-29 22:16:29 +00:00
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0);
|
2009-10-22 19:17:46 +00:00
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0);
|
|
|
|
|
WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0);
|
|
|
|
|
|
|
|
|
|
}
|