2.5 Paint:
[blender-staging.git] / source / blender / editors / sculpt_paint / paint_ops.c
index 5d6589b7d8cef415f38d5fd17154cd4d45f96742..63a6591d0576b96b934b8a0e55c965446d37fff9 100644 (file)
 /* 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);