[Bf-blender-cvs] [6ba26e6ab55] greasepencil-object: Fix infinite loop if color is missing

Antonio Vazquez noreply at git.blender.org
Tue Feb 27 11:47:12 CET 2018


Commit: 6ba26e6ab556ff3982f63d68fa5bc8eed100e688
Author: Antonio Vazquez
Date:   Tue Feb 27 11:47:03 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6ba26e6ab556ff3982f63d68fa5bc8eed100e688

Fix infinite loop if color is missing

Usually, this never happens, but if any color is missing, needed to add to hash to avoid the creation of duplicate materials.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 6b29a436cfc..94a249ca730 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6676,6 +6676,8 @@ static void lib_link_gpencil(FileData *fd, Main *main)
 								gps->palcolor = BKE_palette_color_add_name(gps->palette, gps->colorname);
 								/* Set to a different color. */
 								ARRAY_SET_ITEMS(gps->palcolor->rgb, 1.0f, 0.0f, 1.0f, 1.0f);
+								/* add to hash for avoiding create again */
+								BLI_ghash_insert(gp_palettecolors_buffer[i], gps->palcolor->info, gps->palcolor);
 							}
 						}



More information about the Bf-blender-cvs mailing list