[Bf-blender-cvs] [7f444d8b345] greasepencil-object: Fix error if apply modifier with multi-user GP
Antonio Vazquez
noreply at git.blender.org
Tue Jul 25 16:05:36 CEST 2017
Commit: 7f444d8b3456a1a6c8b4655d127f0475223ec18f
Author: Antonio Vazquez
Date: Tue Jul 25 10:04:49 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB7f444d8b3456a1a6c8b4655d127f0475223ec18f
Fix error if apply modifier with multi-user GP
The modifier cannot be applied if the GP datablock is used for more than 1 objects.
===================================================================
M source/blender/editors/object/object_modifier.c
===================================================================
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 721f7f87ce0..04568276ded 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -707,6 +707,11 @@ int ED_object_modifier_apply(ReportList *reports, const bContext *C, Scene *scen
return 0;
}
+ if (((ID *)ob->gpd)->us > 1) {
+ BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied to multi-user data");
+ return 0;
+ }
+
modifier_apply_obdata(reports, C, scene, ob, md);
BLI_remlink(&ob->modifiers, md);
modifier_free(md);
More information about the Bf-blender-cvs
mailing list