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:
authorCampbell Barton <ideasman42@gmail.com>2018-01-10 11:58:05 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-01-10 11:58:05 +0300
commit2b56faebe5f2a8e2b37004485206007d22cdac1d (patch)
treef96042f4c8f9b9c06b3b9f694d207f1bc62a5a5c /source/blender/blenkernel/intern
parent5ff33ecdf0ed319db2e589926a614f67738531a6 (diff)
parent18f53d8822518928baceab1407eac195ab9bf817 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/brush.c6
-rw-r--r--source/blender/blenkernel/intern/deform.c2
-rw-r--r--source/blender/blenkernel/intern/image.c4
-rw-r--r--source/blender/blenkernel/intern/paint.c4
4 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 230db6dccff..8d63c1cfb44 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -148,6 +148,9 @@ void BKE_brush_init(Brush *brush)
BKE_brush_curve_preset(brush, CURVE_PRESET_SMOOTH);
}
+/**
+ * \note Resulting brush will have two users: one as a fake user, another is assumed to be used by the caller.
+ */
Brush *BKE_brush_add(Main *bmain, const char *name, short ob_mode)
{
Brush *brush;
@@ -1063,7 +1066,8 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
for (i = 0; i < side; ++i) {
for (j = 0; j < side; ++j) {
const int col = texcache[i * side + j];
- im->rect_float[i * side + j] *= (((char *)&col)[0] + ((char *)&col)[1] + ((char *)&col)[2]) / 3.0f / 255.0f;
+ im->rect_float[i * side + j] *=
+ (((char *)&col)[0] + ((char *)&col)[1] + ((char *)&col)[2]) / 3.0f / 255.0f;
}
}
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 1fc83b69bfe..d4ff9bd5c0c 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -628,7 +628,7 @@ float defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int
* (i.e. maximum weight, as if no vgroup was selected).
* But in case of valid defgroup and NULL dvert data pointer, it means that vgroup **is** valid,
* and just totally empty, so we shall return '0.0' value then!
- */
+ */
if (defgroup == -1) {
return 1.0f;
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 59fadffe22a..dbb596b1cd6 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -113,9 +113,9 @@ static void image_add_view(Image *ima, const char *viewname, const char *filepat
/* quick lookup: supports 1 million frames, thousand passes */
#define IMA_MAKE_INDEX(frame, index) (((frame) << 10) + (index))
#define IMA_INDEX_FRAME(index) ((index) >> 10)
-/*
+#if 0
#define IMA_INDEX_PASS(index) (index & ~1023)
-*/
+#endif
/* ******** IMAGE CACHE ************* */
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 11702236066..47df20906c7 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -532,8 +532,10 @@ void BKE_paint_init(Scene *sce, ePaintMode mode, const char col[3])
short ob_mode = BKE_paint_object_mode_from_paint_mode(mode);
brush = BKE_brush_first_search(G.main, ob_mode);
- if (!brush)
+ if (!brush) {
brush = BKE_brush_add(G.main, "Brush", ob_mode);
+ id_us_min(&brush->id); /* fake user only */
+ }
BKE_paint_brush_set(paint, brush);
}