[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59167] branches/soc-2013-paint: * Rename texture_colors_flip to brush_colors_flip
Antony Riakiotakis
kalast at gmail.com
Thu Aug 15 16:28:04 CEST 2013
Revision: 59167
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59167
Author: psy-fi
Date: 2013-08-15 14:28:04 +0000 (Thu, 15 Aug 2013)
Log Message:
-----------
* Rename texture_colors_flip to brush_colors_flip
* Use labels to make brush color UI more readable and tidy
* Expose brush color flip operator on UI
Modified Paths:
--------------
branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_intern.h
branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_ops.c
Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-08-15 12:28:30 UTC (rev 59166)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_image.py 2013-08-15 14:28:04 UTC (rev 59167)
@@ -731,6 +731,7 @@
if not brush.use_gradient:
col.template_color_picker(brush, "color", value_slider=True)
col.prop(brush, "use_gradient")
+
if brush.use_gradient:
if brush.image_tool == 'DRAW':
col.prop(brush, "gradient_stroke_mode")
@@ -739,12 +740,20 @@
elif brush.image_tool == 'FILL':
col.prop(brush, "gradient_fill_mode")
+ col.label("Gradient Colors")
col.template_color_ramp(brush, "gradient", expand=True)
+ if brush.image_tool != 'FILL':
+ col.label("Secondary Color")
+ col.prop(brush, "secondary_color", text="")
+ col.operator("paint.brush_colors_flip", icon='FILE_REFRESH')
else:
col = layout.column(align=True)
col.prop(brush, "color", text="")
- if brush.image_tool != 'FILL':
- col.prop(brush, "secondary_color", text="")
+
+ if brush.image_tool != 'FILL':
+ col.prop(brush, "secondary_color", text="")
+ col.operator("paint.brush_colors_flip", icon='FILE_REFRESH')
+
col = layout.column()
col.template_ID(toolsettings, "palette", new="palette.new")
if toolsettings.palette:
Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-08-15 12:28:30 UTC (rev 59166)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py 2013-08-15 14:28:04 UTC (rev 59167)
@@ -688,6 +688,7 @@
if not brush.use_gradient:
col.template_color_picker(brush, "color", value_slider=True)
col.prop(brush, "use_gradient")
+
if brush.use_gradient:
if brush.image_tool == 'DRAW':
col.prop(brush, "gradient_stroke_mode")
@@ -696,12 +697,20 @@
elif brush.image_tool == 'FILL':
col.prop(brush, "gradient_fill_mode")
+ col.label("Gradient Colors")
col.template_color_ramp(brush, "gradient", expand=True)
+
+ if brush.image_tool != 'FILL':
+ col.label("Secondary Color")
+ col.prop(brush, "secondary_color", text="")
+ col.operator("paint.brush_colors_flip", icon='FILE_REFRESH')
else:
col = layout.column(align=True)
col.prop(brush, "color", text="")
- if brush.image_tool != 'FILL':
- col.prop(brush, "secondary_color", text="")
+ if brush.image_tool != 'FILL':
+ col.prop(brush, "secondary_color", text="")
+ col.operator("paint.brush_colors_flip", icon='FILE_REFRESH')
+
col = layout.column()
col.template_ID(settings, "palette", new="palette.new")
if settings.palette:
Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c 2013-08-15 12:28:30 UTC (rev 59166)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_image.c 2013-08-15 14:28:04 UTC (rev 59167)
@@ -1317,7 +1317,7 @@
}
-static int texture_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
+static int brush_colors_flip_exec(bContext *C, wmOperator *UNUSED(op))
{
Brush *br = image_paint_brush(C);
swap_v3_v3(br->rgb, br->secondary_rgb);
@@ -1327,7 +1327,7 @@
return OPERATOR_FINISHED;
}
-static int texture_colors_flip_poll(bContext *C)
+static int brush_colors_flip_poll(bContext *C)
{
if (image_paint_poll(C)) {
Brush *br = image_paint_brush(C);
@@ -1338,16 +1338,16 @@
return 0;
}
-void PAINT_OT_texture_colors_flip(wmOperatorType *ot)
+void PAINT_OT_brush_colors_flip(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Texture Colors Flip";
- ot->idname = "PAINT_OT_texture_colors_flip";
- ot->description = "Toggle foreground and background texture paint colors";
+ ot->name = "Brush Colors Flip";
+ ot->idname = "PAINT_OT_brush_colors_flip";
+ ot->description = "Toggle foreground and background brush colors";
/* api callbacks */
- ot->exec = texture_colors_flip_exec;
- ot->poll = texture_colors_flip_poll;
+ ot->exec = brush_colors_flip_exec;
+ ot->poll = brush_colors_flip_poll;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_intern.h
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_intern.h 2013-08-15 12:28:30 UTC (rev 59166)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_intern.h 2013-08-15 14:28:04 UTC (rev 59167)
@@ -172,7 +172,7 @@
void PAINT_OT_grab_clone(struct wmOperatorType *ot);
void PAINT_OT_sample_color(struct wmOperatorType *ot);
-void PAINT_OT_texture_colors_flip(struct wmOperatorType *ot);
+void PAINT_OT_brush_colors_flip(struct wmOperatorType *ot);
void PAINT_OT_texture_paint_toggle(struct wmOperatorType *ot);
void PAINT_OT_project_image(struct wmOperatorType *ot);
void PAINT_OT_image_from_view(struct wmOperatorType *ot);
Modified: branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_ops.c
===================================================================
--- branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_ops.c 2013-08-15 12:28:30 UTC (rev 59166)
+++ branches/soc-2013-paint/source/blender/editors/sculpt_paint/paint_ops.c 2013-08-15 14:28:04 UTC (rev 59167)
@@ -1029,7 +1029,7 @@
WM_operatortype_append(PAINT_OT_grab_clone);
WM_operatortype_append(PAINT_OT_project_image);
WM_operatortype_append(PAINT_OT_image_from_view);
- WM_operatortype_append(PAINT_OT_texture_colors_flip);
+ WM_operatortype_append(PAINT_OT_brush_colors_flip);
/* weight */
WM_operatortype_append(PAINT_OT_weight_paint_toggle);
@@ -1345,7 +1345,7 @@
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, 0, 0)->ptr, "mode", BRUSH_STROKE_NORMAL);
RNA_enum_set(WM_keymap_add_item(keymap, "PAINT_OT_image_paint", LEFTMOUSE, KM_PRESS, KM_CTRL, 0)->ptr, "mode", BRUSH_STROKE_INVERT);
- WM_keymap_add_item(keymap, "PAINT_OT_texture_colors_flip", XKEY, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "PAINT_OT_brush_colors_flip", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_grab_clone", RIGHTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "PAINT_OT_sample_color", SKEY, KM_PRESS, 0, 0);
ed_keymap_paint_brush_switch(keymap, "image_paint");
More information about the Bf-blender-cvs
mailing list