Fix unreported: Crash when adding lattice vertex group
authorDalai Felinto <dfelinto@gmail.com>
Fri, 26 Oct 2018 16:44:14 +0000 (13:44 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 26 Oct 2018 16:48:14 +0000 (13:48 -0300)
source/blender/blenkernel/intern/deform.c

index 78a287919d00a60a8ce630e170828a41a3fc51fd..bbb7fc4b3bde33b7e04c973827a886a2cefb899c 100644 (file)
@@ -56,6 +56,7 @@
 #include "BKE_deform.h"  /* own include */
 #include "BKE_mesh.h"
 #include "BKE_mesh_mapping.h"
+#include "BKE_object.h"
 #include "BKE_object_deform.h"
 
 #include "data_transfer_intern.h"
@@ -74,9 +75,7 @@ bDeformGroup *BKE_defgroup_new(Object *ob, const char *name)
        BLI_addtail(&ob->defbase, defgroup);
        defgroup_unique_name(defgroup, ob);
 
-       if (ob->type != OB_GPENCIL) {
-               BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
-       }
+       BKE_object_batch_cache_dirty_tag(ob);
 
        return defgroup;
 }