[Bf-blender-cvs] [6622673b3f7] greasepencil-object: Fix error with user number
Antonio Vazquez
noreply at git.blender.org
Tue Jul 25 16:05:40 CEST 2017
Commit: 6622673b3f76f48d9645b700275a26f3e47b36d2
Author: Antonio Vazquez
Date: Tue Jul 25 11:14:18 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB6622673b3f76f48d9645b700275a26f3e47b36d2
Fix error with user number
When apply array modifier the gpd is not reused, so the us must remain equal.
===================================================================
M source/blender/modifiers/intern/MOD_gpencilarray.c
===================================================================
diff --git a/source/blender/modifiers/intern/MOD_gpencilarray.c b/source/blender/modifiers/intern/MOD_gpencilarray.c
index c175a7db266..c11587bbbfd 100644
--- a/source/blender/modifiers/intern/MOD_gpencilarray.c
+++ b/source/blender/modifiers/intern/MOD_gpencilarray.c
@@ -142,6 +142,7 @@ static DerivedMesh *applyModifier(ModifierData *md, struct EvaluationContext *UN
/* create a new object and new gp datablock */
newob = object_add_type(C, OB_GPENCIL, md->name, ob);
+ id_us_min((ID *)ob->gpd);
newob->gpd = BKE_gpencil_data_duplicate(bmain, ob->gpd, false);
/* remove array on destination object */
fmd = (ModifierData *) BLI_findstring(&newob->modifiers, md->name, offsetof(ModifierData, name));
More information about the Bf-blender-cvs
mailing list