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-22 06:27:37 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2009-08-22 06:27:37 +0400
commit0be1e72dca48a6709c2ae8b3805387d4ef5bcdcb (patch)
tree4fc4833e0280051203a765da2b5f587251291b78 /source/blender/editors/sculpt_paint/paint_ops.c
parent095ec3a6e9357e6ce14fd200396ea221ac88e3b6 (diff)
2.5/Vertex paint:
* Added operator for filling vertex colors with the brush color * Pythonized the vertex paint menu
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_ops.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_ops.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 1ea612c0aa5..c38b36007e9 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -77,6 +77,32 @@ void BRUSH_OT_add(wmOperatorType *ot)
RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_VERTEX_PAINT, "Type", "Which paint mode to create the brush for.");
}
+static int vertex_color_set_exec(bContext *C, wmOperator *op)
+{
+ int selected = RNA_boolean_get(op->ptr, "selected");
+ Scene *scene = CTX_data_scene(C);
+
+ clear_vpaint(scene, selected);
+
+ 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;
+
+ RNA_def_boolean(ot->srna, "selected", 0, "Type", "Only color selected faces.");
+}
+
/**************************** registration **********************************/
void ED_operatortypes_paint(void)
@@ -103,5 +129,6 @@ void ED_operatortypes_paint(void)
WM_operatortype_append(PAINT_OT_vertex_paint_radial_control);
WM_operatortype_append(PAINT_OT_vertex_paint_toggle);
WM_operatortype_append(PAINT_OT_vertex_paint);
+ WM_operatortype_append(PAINT_OT_vertex_color_set);
}