[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36345] trunk/blender/source/blender/ editors/render/render_preview.c: Fix for bug #26590, `Texture preview fails when path to custom brush
Nicholas Bishop
nicholasbishop at gmail.com
Wed Apr 27 03:16:25 CEST 2011
Revision: 36345
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36345
Author: nicholasbishop
Date: 2011-04-27 01:16:24 +0000 (Wed, 27 Apr 2011)
Log Message:
-----------
Fix for bug #26590, `Texture preview fails when path to custom brush
icon is set'
* Main problem was calling BKE_icon_changed too much, blocked previews
from updating
* Also fixed clearing the icon when it's not a valid image path
Review link: http://codereview.appspot.com/4356045/
Modified Paths:
--------------
trunk/blender/source/blender/editors/render/render_preview.c
Modified: trunk/blender/source/blender/editors/render/render_preview.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_preview.c 2011-04-26 15:29:12 UTC (rev 36344)
+++ trunk/blender/source/blender/editors/render/render_preview.c 2011-04-27 01:16:24 UTC (rev 36345)
@@ -135,14 +135,15 @@
if (path[0])
brush->icon_imbuf= IMB_loadiffname(path, flags);
}
+
+ if (brush->icon_imbuf)
+ BKE_icon_changed(BKE_icon_getid(&brush->id));
}
}
}
if (!(brush->icon_imbuf))
brush->id.icon_id = 0;
- else
- BKE_icon_changed(BKE_icon_getid(&(brush->id)));
return brush->icon_imbuf;
}
@@ -1256,10 +1257,11 @@
br->icon_imbuf= get_brush_icon(br);
+ memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigned int));
+
if(!(br->icon_imbuf) || !(br->icon_imbuf->rect))
return;
- memset(sp->pr_rect, 0x888888, sp->sizex*sp->sizey*sizeof(unsigned int));
icon_copy_rect(br->icon_imbuf, sp->sizex, sp->sizey, sp->pr_rect);
*do_update= 1;
More information about the Bf-blender-cvs
mailing list