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:
authorDalai Felinto <dfelinto@gmail.com>2018-10-09 15:42:02 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-10-09 15:43:11 +0300
commit9a670a67d25f54f2f70f1056cfa8823f6817fd22 (patch)
tree07b2d9f003c91871304e70e72125017da320b2bd /source/blender/blenkernel/intern/paint.c
parent85944a2d7e73d1ed070b19e50bc6927b47070091 (diff)
Fix for assert when sampling color to non-existent palette
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r--source/blender/blenkernel/intern/paint.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 070f5daa019..545581e65ec 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -398,10 +398,6 @@ void BKE_palette_clear(Palette *palette)
Palette *BKE_palette_add(Main *bmain, const char *name)
{
Palette *palette = BKE_id_new(bmain, ID_PAL, name);
-
- /* enable fake user by default */
- id_fake_user_set(&palette->id);
-
return palette;
}
@@ -430,6 +426,12 @@ void BKE_palette_make_local(Main *bmain, Palette *palette, const bool lib_local)
BKE_id_make_local_generic(bmain, &palette->id, true, lib_local);
}
+void BKE_palette_init(Palette *palette)
+{
+ /* Enable fake user by default. */
+ id_fake_user_set(&palette->id);
+}
+
/** Free (or release) any data used by this palette (does not free the palette itself). */
void BKE_palette_free(Palette *palette)
{