From 80e63236464a7e864c45e163dd059ffe61735926 Mon Sep 17 00:00:00 2001 From: Jason Wilkins Date: Tue, 20 Jul 2010 02:18:10 +0000 Subject: * Images for brush icons are now reloaded when they are needed from an external file * First, try to load the file from the given filename. This is either absolute or relative to the current .blend * If file is found using the given filename directly then look for the file in the datafiles/brushicons directory (local, user, or system). * Note: This commit does not update the .blend to reference the default icons * Note: This commit does not make sure that the build system copies the default icons to the 2.52/datafiles/brushicons directory --- source/blender/blenloader/intern/readfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader/intern') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fce87302d30..675ccb152d2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1539,8 +1539,11 @@ static void lib_link_brush(FileData *fd, Main *main) brush->id.flag -= LIB_NEEDLINK; brush->mtex.tex= newlibadr_us(fd, brush->id.lib, brush->mtex.tex); - brush->image_icon= newlibadr_us(fd, brush->id.lib, brush->image_icon); brush->clone.image= newlibadr_us(fd, brush->id.lib, brush->clone.image); + + // Image icons not saved if only used as an icon, + // but if it used elsewhere in the file it will have been saved + brush->image_icon= newlibadr_us(fd, brush->id.lib, brush->image_icon); } } } @@ -10981,6 +10984,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) for (brush= main->brush.first; brush; brush= brush->id.next) { /* Sanity Check */ + // brush icon loaded but not the path + //if (brush->image_icon && !(brush->image_icon_path[0])) + // BLI_strncpy(brush->image_icon_path, brush->image_icon->name, sizeof(brush->image_icon_path)); + // infinite number of dabs if (brush->spacing == 0) brush->spacing = 10; -- cgit v1.2.3