Commit: 3e0bf69bfd8360b3a4b90940d59d231832962bf4 Author: Antonioya Date: Wed Aug 8 11:48:18 2018 +0200 Branches: blender2.8 https://developer.blender.org/rB3e0bf69bfd8360b3a4b90940d59d231832962bf4
GP: Change to make the temp name unique The previous commit could fail if some corner situations. This new temp name must be unique always. =================================================================== M source/blender/draw/engines/gpencil/gpencil_draw_utils.c =================================================================== diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 93269d4543f..499eb14e254 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1263,7 +1263,6 @@ static void gp_instance_modifier_make_instances(GPENCIL_StorageList *stl, Object { /* reset random */ mmd->rnd[0] = 1; - char buf[8]; int e = 0; /* Generate instances */ @@ -1287,12 +1286,16 @@ static void gp_instance_modifier_make_instances(GPENCIL_StorageList *stl, Object /* add object to cache */ newob = MEM_dupallocN(ob); - /* create a unique name or the object hash used in draw will fail. + /* Create a unique name or the object hash used in draw will fail. * the name must be unique in the hash, not in the scene because - * the object never is linked to scene. + * the object never is linked to scene and is removed after drawing. + * + * It uses special characters to be sure the name cannot be equal + * to any existing name because UI limits the use of special characters. + * + * Name = OB\t_{pointer}_{index} */ - sprintf(buf, "___%d", e++); - strncat(newob->id.name, buf, sizeof(newob->id.name)); + sprintf(newob->id.name, "OB\t_%p_%d", &ob, e++); mul_m4_m4m4(newob->obmat, ob->obmat, mat); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs