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>2009-08-17 19:05:18 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-17 19:05:18 +0400
commitb0fe88117b923da49486f765521ed4c3d1b58965 (patch)
treebe634f428bf61da291078d6a93cd0b687d6d1c84 /source/blender/editors/sculpt_paint/paint_ops.c
parent9f973bca78877a10b6da5a11b3bafc946879050c (diff)
2.5 Paint:
* Updated the brush selection UI to make the slots less apparent; adding and removing brushes now directly adds and removes slots.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c85
1 files changed, 3 insertions, 82 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 5d6589b7d8c..63a6591d057 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -44,22 +44,13 @@
/* Brush operators */
static int brush_add_exec(bContext *C, wmOperator *op)
{
- int type = RNA_enum_get(op->ptr, "type");
- int sculpt_tool = SCULPT_TOOL_DRAW;
- const char *name = "Brush";
+ /*int type = RNA_enum_get(op->ptr, "type");*/
Brush *br = NULL;
- if(type == OB_MODE_SCULPT) {
- sculpt_tool = RNA_enum_get(op->ptr, "sculpt_tool");
- RNA_enum_name(brush_sculpt_tool_items, sculpt_tool, &name);
- }
+ br = add_brush("Brush");
- br = add_brush(name);
-
- if(br) {
- br->sculpt_tool = sculpt_tool;
+ if(br)
paint_brush_set(paint_get_active(CTX_data_scene(C)), br);
- }
return OPERATOR_FINISHED;
}
@@ -71,23 +62,6 @@ static EnumPropertyItem brush_type_items[] = {
{OB_MODE_TEXTURE_PAINT, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""},
{0, NULL, 0, NULL, NULL}};
-void SCULPT_OT_brush_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Brush";
- ot->idname= "SCULPT_OT_brush_add";
-
- /* api callbacks */
- ot->exec= brush_add_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- RNA_def_enum(ot->srna, "sculpt_tool", brush_sculpt_tool_items, SCULPT_TOOL_DRAW, "Sculpt Tool", "");
-
- RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_SCULPT, "Type", "Which paint mode to create the brush for.");
-}
-
void BRUSH_OT_add(wmOperatorType *ot)
{
/* identifiers */
@@ -109,67 +83,14 @@ static int paint_poll(bContext *C)
return !!paint_get_active(CTX_data_scene(C));
}
-static int brush_slot_add_exec(bContext *C, wmOperator *op)
-{
- Paint *p = paint_get_active(CTX_data_scene(C));
-
- paint_brush_slot_add(p);
-
- return OPERATOR_FINISHED;
-}
-
-void PAINT_OT_brush_slot_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Brush Slot";
- ot->idname= "PAINT_OT_brush_slot_add";
-
- /* api callbacks */
- ot->poll= paint_poll;
- ot->exec= brush_slot_add_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
-static int brush_slot_remove_exec(bContext *C, wmOperator *op)
-{
- Paint *p = paint_get_active(CTX_data_scene(C));
-
- paint_brush_slot_remove(p);
-
- return OPERATOR_FINISHED;
-}
-
-void PAINT_OT_brush_slot_remove(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Remove Brush Slot";
- ot->idname= "PAINT_OT_brush_slot_remove";
-
- /* api callbacks */
- ot->poll= paint_poll;
- ot->exec= brush_slot_remove_exec;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-
/**************************** registration **********************************/
void ED_operatortypes_paint(void)
{
- /* paint */
- WM_operatortype_append(PAINT_OT_brush_slot_add);
- WM_operatortype_append(PAINT_OT_brush_slot_remove);
-
/* brush */
WM_operatortype_append(BRUSH_OT_add);
WM_operatortype_append(BRUSH_OT_curve_preset);
- /* sculpt */
- WM_operatortype_append(SCULPT_OT_brush_add);
-
/* image */
WM_operatortype_append(PAINT_OT_texture_paint_toggle);
WM_operatortype_append(PAINT_OT_texture_paint_radial_control);