Revision: 39512
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39512
Author: psy-fi
Date: 2011-08-17 22:37:35 +0000 (Wed, 17 Aug 2011)
Log Message:
-----------
uv paint brushes
=================
-Fix for incorrect brush showing in image paint if uv paint is on: disable
image paint checkbox when in UV paint mode. This makes it possible to
differentiate between the two brushes at paint_get_active, simply by checking
if uv painting is on. Ideally I would give priority to image painting but it is
impossible to get the spaceimage structure in the aforementioned function since
it depends on the context. However, uv paint is a toolsetting variable and much
more accessible.
Modified Paths:
--------------
branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
Modified: branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
2011-08-17 21:56:18 UTC (rev 39511)
+++ branches/soc-2011-onion/release/scripts/startup/bl_ui/space_image.py
2011-08-17 22:37:35 UTC (rev 39512)
@@ -146,8 +146,9 @@
if ima.source in {'FILE', 'GENERATED'} and ima.type !=
'MULTILAYER':
layout.operator("image.pack", text="Pack As
PNG").as_png = True
- layout.separator()
- layout.prop(sima, "use_image_paint")
+ if not context.tool_settings.use_uv_paint:
+ layout.separator()
+ layout.prop(sima, "use_image_paint")
layout.separator()
layout.operator("paint.vertex_colors_to_texture")
Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
2011-08-17 21:56:18 UTC (rev 39511)
+++ branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
2011-08-17 22:37:35 UTC (rev 39512)
@@ -72,12 +72,12 @@
case OB_MODE_TEXTURE_PAINT:
return &ts->imapaint.paint;
case OB_MODE_EDIT:
- return &ts->uvpaint->paint;
+ if(ts->use_uv_paint)
+ return &ts->uvpaint->paint;
+ else
+ return &ts->imapaint.paint;
}
}
-
- /* default to image paint */
- return &ts->imapaint.paint;
}
return NULL;
Modified:
branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
2011-08-17 21:56:18 UTC (rev 39511)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/paint_image.c
2011-08-17 22:37:35 UTC (rev 39512)
@@ -5103,22 +5103,12 @@
void ED_space_image_uv_paint_update(wmWindowManager *wm, ToolSettings
*settings)
{
- if(!settings->uvpaint){
- settings->uvpaint = MEM_callocN(sizeof(*settings->uvpaint), "UV
Smooth paint");
- settings->uv_paint_tool = UV_PAINT_TOOL_GRAB;
- settings->uv_paint_settings = UV_PAINT_PIN_EDGES |
UV_PAINT_ALL_ISLANDS;
- settings->uv_relax_method = UV_PAINT_TOOL_RELAX_LAPLACIAN;
- }
- paint_mode_init(
- wm,
- &(settings->uvpaint->paint),
- OB_MODE_TEXTURE_PAINT,
- uv_paint_brush_poll,
- brush_drawcursor,
- NULL);
if(settings->use_uv_paint){
if(!settings->uvpaint){
settings->uvpaint =
MEM_callocN(sizeof(*settings->uvpaint), "UV Smooth paint");
+ settings->uv_paint_tool = UV_PAINT_TOOL_GRAB;
+ settings->uv_paint_settings = UV_PAINT_PIN_EDGES |
UV_PAINT_ALL_ISLANDS;
+ settings->uv_relax_method =
UV_PAINT_TOOL_RELAX_LAPLACIAN;
}
paint_mode_init(
wm,
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs