From 5b1231849cd2f87af24d13b6631199ba28e100e6 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 26 Jul 2010 02:35:43 +0000 Subject: * Factored out some duplicated code from rna_brush into paint.c, added a new function that checks whether a brush is used by that paint struct * Fixed an improperly initialized variable in BKE_previewing_free_id * Added an RNA access function to get the icon associated with a value --- source/blender/blenkernel/intern/paint.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source/blender/blenkernel/intern/paint.c') diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index cf5deb95258..fcbe8d65d64 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -192,3 +192,15 @@ void copy_paint(Paint *orig, Paint *new) id_us_plus((ID *)new->brushes[i]); } } + +int paint_has_brush(Paint *p, Brush *brush) +{ + int i; + + for (i= 0; i < p->brush_count; i++) { + if (strcmp(brush->id.name+2, p->brushes[i]->id.name+2) == 0) + return 1; + } + + return 0; +} -- cgit v1.2.3