[Bf-blender-cvs] [d7af1c7bd96] master: Fix: Mesh to Volume modifier crashes when object is in edit mode

Jacques Lucke noreply at git.blender.org
Thu Oct 1 15:56:13 CEST 2020


Commit: d7af1c7bd96b2800c4150ff515a713038176f370
Author: Jacques Lucke
Date:   Thu Oct 1 15:53:50 2020 +0200
Branches: master
https://developer.blender.org/rBd7af1c7bd96b2800c4150ff515a713038176f370

Fix: Mesh to Volume modifier crashes when object is in edit mode

Bug and fix has been found by dfelinto, thanks.

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

M	source/blender/modifiers/intern/MOD_mesh_to_volume.cc

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

diff --git a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
index b5d462ce842..ce8a456f66f 100644
--- a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
+++ b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
@@ -22,6 +22,7 @@
 
 #include "BKE_lib_query.h"
 #include "BKE_mesh_runtime.h"
+#include "BKE_mesh_wrapper.h"
 #include "BKE_modifier.h"
 #include "BKE_object.h"
 #include "BKE_volume.h"
@@ -213,6 +214,7 @@ static Volume *modifyVolume(ModifierData *md, const ModifierEvalContext *ctx, Vo
   if (mesh == NULL) {
     return input_volume;
   }
+  BKE_mesh_wrapper_ensure_mdata(mesh);
 
   const float4x4 mesh_to_own_object_space_transform = float4x4(ctx->object->imat) *
                                                       float4x4(object_to_convert->obmat);



More information about the Bf-blender-cvs mailing list