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:
authorJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-20 17:42:27 +0400
committerJason Wilkins <Jason.A.Wilkins@gmail.com>2010-07-20 17:42:27 +0400
commit886ce5a35101ea8bfef9c02745a94b1ab017f12f (patch)
treecb3f418bb74daa4411a9267039bcfa6e957bfbdc /source/blender/makesrna/intern/rna_brush.c
parenta1494105657e0cc428b6e9163df500d0fe5b3176 (diff)
* can use file for brush icon
* fixed memory leaks * moved some of the brush icon code around * the update of the icon after a change is more responsive
Diffstat (limited to 'source/blender/makesrna/intern/rna_brush.c')
-rw-r--r--source/blender/makesrna/intern/rna_brush.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index b73b5f22141..bc71a862f4b 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -110,11 +110,12 @@ static void rna_Brush_icon_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
Brush *br= (Brush*)ptr->data;
- if (br->icon==BRUSH_ICON_FILE && br->icon_imbuf)
+ if (br->icon_imbuf) {
IMB_freeImBuf(br->icon_imbuf);
+ br->icon_imbuf= NULL;
+ }
- br->icon_imbuf= NULL;
- br->icon_imbuf= get_brush_icon(br);
+ BKE_icon_changed(BKE_icon_getid(&(br->id)));
WM_main_add_notifier(NC_BRUSH|NA_EDITED, br);
}
@@ -260,7 +261,7 @@ static void rna_def_brush(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem brush_icon_items[] = {
- //{BRUSH_ICON_FILE, "FILE", 0, "File", ""},
+ {BRUSH_ICON_FILE, "FILE", 0, "Use Image File", ""},
{BRUSH_ICON_BLOB, "BLOB", 0, "Blob", ""},
{BRUSH_ICON_CREASE, "CREASE", 0, "Crease", ""},
{BRUSH_ICON_CLAY, "CLAY", 0, "Clay", ""},