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:
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py2
-rw-r--r--source/blender/blenkernel/BKE_paint.h2
-rw-r--r--source/blender/blenkernel/intern/paint.c23
3 files changed, 15 insertions, 12 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 3c3d43ac8bd..436e420ee7e 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1002,7 +1002,7 @@ class _defs_image_uv_sculpt:
return generate_from_enum_ex(
context,
icon_prefix="brush.uv_sculpt.",
- data=context.tool_settings,
+ type=bpy.types.ToolSettings,
attr="uv_sculpt_tool",
)
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index e09aed4b372..00425de50e0 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -90,6 +90,8 @@ typedef enum ePaintMode {
PAINT_MODE_INVALID = 7,
} ePaintMode;
+#define PAINT_MODE_HAS_BRUSH(mode) !ELEM(mode, PAINT_MODE_SCULPT_UV)
+
/* overlay invalidation */
typedef enum eOverlayControlFlags {
PAINT_OVERLAY_INVALID_TEXTURE_PRIMARY = 1,
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 24782af4d22..9445981538e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -689,29 +689,30 @@ bool BKE_paint_ensure(const ToolSettings *ts, struct Paint **r_paint)
paint->flags |= PAINT_SHOW_BRUSH;
+ *r_paint = paint;
+
BKE_paint_runtime_init(ts, paint);
- *r_paint = paint;
return false;
}
void BKE_paint_init(Main *bmain, Scene *sce, ePaintMode mode, const char col[3])
{
UnifiedPaintSettings *ups = &sce->toolsettings->unified_paint_settings;
- Brush *brush;
Paint *paint = BKE_paint_get_active_from_paintmode(sce, mode);
/* If there's no brush, create one */
- brush = BKE_paint_brush(paint);
- if (brush == NULL) {
- eObjectMode ob_mode = BKE_paint_object_mode_from_paintmode(mode);
- brush = BKE_brush_first_search(bmain, ob_mode);
-
- if (!brush) {
- brush = BKE_brush_add(bmain, "Brush", ob_mode);
- id_us_min(&brush->id); /* fake user only */
+ if (PAINT_MODE_HAS_BRUSH(mode)) {
+ Brush *brush = BKE_paint_brush(paint);
+ if (brush == NULL) {
+ eObjectMode ob_mode = BKE_paint_object_mode_from_paintmode(mode);
+ brush = BKE_brush_first_search(bmain, ob_mode);
+ if (!brush) {
+ brush = BKE_brush_add(bmain, "Brush", ob_mode);
+ id_us_min(&brush->id); /* fake user only */
+ }
+ BKE_paint_brush_set(paint, brush);
}
- BKE_paint_brush_set(paint, brush);
}
memcpy(paint->paint_cursor_col, col, 3);